Write a program to find the factorial of an integer using while loop.

 

#include<stdio.h>

#include<conio.h>

int main()

{

int a,N=1;

printf(“Enter a number to find its factorial:”);

scanf(“%d”,&a);

while(a>1)

{

N=N*a;

a–;

}

printf(“%d is factorial”,N);

getch();

return 0;

}