WRITE A PROGRAM TO PRINT PRODUCT OF DIGITS


#include<stdio.h>
#include<conio.h>
void main()
{
long int n,r=0,p=1;

clrscr();

printf("enter a number");

scanf("%ld",&n);

if(n<0)
printf("WRONG INPUT");

else
{

while(n>0)
{
r=n%10;
p=p*r;
n=n/10;
}
printf("PRODUCT OF DIGITS =%ld",p);

}
getch();

}

SIMPLE PROGRAMS
FUNCTIONS


NUMBERS


STRINGS AND CHARACTERS

Comments