Best collection of C programs
Tuesday, January 4, 2011
FACTORIAL NUMBER
WAP TO FIND THE FACTORIAL OF THE NUMBER
(1X2X3X4)
void main ()
{
int fact=1,no;
clrscr();
printf ("Enter any number: ");
scanf ("%d",&no);
do
{
fact=fact*no;
no--;
}
while (no>0);
printf ("\nFactorial is %d",fact);
getch ();
}
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment