COMPUTER PROGRAMMING
Pages
Home
Saturday, 15 September 2012
FACTORIAL OF A NUMBER
/*Factorial Of A Number*/
#include<stdio.h>
#include<conio.h>
void main()
{
int n,fact=1,i=1;
printf("enter number");
scanf("%d",&n);
while(i<=n)
{
fact=fact*i;
i++;
}
printf("factorial is %d",fact);
getch();
}
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment