Program to find the product of digits of any number. My program works correct except for one type of input like 09,08,03... | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Program to find the product of digits of any number. My program works correct except for one type of input like 09,08,03...

#include <stdio.h> int main() { int x,d,p=1,y; scanf("%d",&x); if(x==0) p=0; else while(x>0) { d=x%10; p=p*d; x=x/10; } printf("product is %d",p); return 0; }

21st Jul 2017, 6:13 PM
Abhishek Gunjan
Abhishek Gunjan - avatar
1 Answer
0
shouldnt It be a Double?
23rd Jul 2017, 10:25 AM
Gabrielle Cristine
Gabrielle Cristine - avatar