Decode School

Decode School - The School for Problem Solvers

Welcome to my blog. Subscribe and get my latest blog post in your inbox.

C Program to calculate product of digits.

Sample Input 1 :

734

Sample Output 1 :

84 (7*3*4)

Program or Solution

					    
							
#include<stdio.h>
int main()
{
	int num,sum;
	scanf("%d",&num);
	while(num!=0)
	{
		sum+=num%10;
		num/=10;
	}
	printf("sum is %d",sum);
	return 0;
}
		
					    
					

Program Explanation

refer video tutorial