Program to find Factorial of a given number

#include<conio.h>

#include<stdio.h>

void main()

{

int n,i,f;

clrscr();

printf("Enter the value of n");

scanf("%d",&n);

for(i=0;f=1;i<=n;i++)

{

f=f*i;

}

printf("%d",f);

getch();

}

Output

Enter the value of n=4

24

Enter the value of n=5

120

Comments

Popular posts from this blog

Gove confirms mandatory housebuilding targets for councils will be abolished in face of Tory rebellion – UK politics live

Kotak Mahindra Bank Recruitment 2022 Released for Graduate Candidates And Apply Online