Computer Science, asked by amit00145, 1 year ago

write a program to find the factorial of given number using constructor.

Answers

Answered by shekhar73
1

Program 1: Factorial program in c using for loop

#include<stdio.h>

int main(){

int i,f=1,num;

printf("Enter a number: ");

scanf("%d",&num);

for(i=1;i<=num;i++)

f=f*i;

printf("Factorial of %d is: %d",num,f);

return 0;

Similar questions