google-site-verification: googlef8aa845b858144d3.html COMPUTER SCIENCE NOTES: PRODUCT OF DIGITS

Monday, July 17, 2017

PRODUCT OF DIGITS

 /*find the product of digits */
 #include<stdio.h>
 #include<conio.h>
 void main()
 {
int rem,prod=1,n;
clrscr();
printf("Enter a integer :");
scanf("%d",&n);
while(n>0)
{
rem=n%10;
prod*=rem;
n/=10;
}
printf("factorial %d",prod);
getch();
 }

No comments:

Post a Comment