Factorial C Program Input From User - HelpMeOutAlways

Tuesday, May 29, 2018

Factorial C Program Input From User

//Factorial program
#include<stdio.h>
main()
{
int num,fact=1,i;
printf("Enter a number to check its factorial:\n");
scanf("%d",&num);
for(i=1;i<=num;i++)
{
fact=fact*i;

}
printf("fact of %d is=%d",num,fact);
return 0;}

OUTPUT
C program output factorial


No comments:

@way2themes