First time here? Checkout the FAQ!
x
menu search
brightness_auto
more_vert

Write a program to find the factorial of a given number.

thumb_up_off_alt 0 like thumb_down_off_alt 0 dislike

1 Answer

more_vert
 
verified
Best answer
#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;
}
thumb_up_off_alt 0 like thumb_down_off_alt 0 dislike
...