Write a program to find the factorial value of any number entered through the keyboard.



#include<stdio.h>

int main()
{
  int x,y=1,num;

  printf("Enter a number: ");
  scanf("%d",&num);

  for(x=1;x<=num;x++)
      y=y*x;

  printf("Factorial value is: %d",y);
  return 0;
}

Comments

Post a Comment