write a programme to find factorial of a number using for statement by using int
Answers
Answered by
2
#include<stdio.h>
int main(){
long f=1;
int i,num,min,max;
printf("Enter the minimum range: ");
scanf("%d",&min);
printf("Enter the maximum range: ");
scanf("%d",&max);
printf("Factorial series in given range: ");
for(num=min;num<=max;num++){
f=1;
for(i=1;i<=num;i++)
f=f*i;
printf("%ld ",f);
}
return 0;
}
Similar questions
Computer Science,
5 months ago
Biology,
5 months ago
Accountancy,
5 months ago
Science,
10 months ago
Math,
10 months ago
Math,
1 year ago
Math,
1 year ago
Biology,
1 year ago