Showing posts with label Factorial of Number Using While Loop. Show all posts
Showing posts with label Factorial of Number Using While Loop. Show all posts

Friday, 19 August 2011

Factorial of Number Using While Loop

#nclude <stdio.h>
#include <conio.h>
void main()
{
int i=1,n,fact=1;
clrscr();
printf("enter a number");
scanf("%d",&n);
while(i<=n)
{
fact=fact*i;
printf("%d",i);
i++;
}
printf("fact=%d",fact);
getch();
}