write a program to find the Factorial number using for loop.
#include<stdio.h>
int main()
{
int i,fact=1,num;
printf("Enter a number: ");
scanf("%d",&num);
for(i=1;i<=num;i++)
fact=fact*i;
printf("Factorial of %d is: %d",num,fact);
return 0;
}
Hello, my name is Jack Sparrow. I'm a 50 year old self-employed Pirate from the Caribbean.
Learn More →
No comments:
Post a Comment