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

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();
}

Labels