write a program to find factorial of a number by using while loop.

#include<stdio.h>
#include<conio.h>
int main()
{
int num,i=1;
int fact=1;
printf("enter the number\n");
scanf("%d",&num);
while(i<=num)
{
fact=fact*i;
i++;
}
printf("\n factorial of %d is %d",num,fact);
return 0;
}

Comments

Popular posts from this blog