Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

please explain this program?

SamirNarangSamirNarang IndiaMember Posts: 2

include<stdio.h>

include<conio.h>

int main()
{
int num,fact=1;
printf("enter the value of k");
scanf("%d",&num);
if(num==0)
fact=1;
else
{
for (int i=1;i<=num;i++)
fact=fact*i;

}
printf("factor %d",fact);
return 0;

}

Tagged:

Comments

Sign In or Register to comment.