Level 2: C loop - find the product of each number ------- C language programming technology (loop structure programming 2)

Level 2: C loop - find the product of each number ------- C language programming technology (loop structure programming 2)

#include<stdio.h>
	int main(void)
	{  
	  /*********Begin*********/
	  int n,a,chengji=1;
	  scanf("%d",&n);
	  a=n%10;
	  while(n!=0) 
	  {
		  chengji=chengji*a;
		  n=n/10;
		  a=n%10;
	  }
	  printf("%d",chengji);
	  /*********End**********/ 
	}

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=324075530&siteId=291194637