Menus

Friday 27 March 2020

Write C program to find factorial of a number


#include<stdio.h>

void main()
{


int n,fact;

printf("Enter the number ");
scanf("%d",&n);

fact=1;

while(n!=0)
{
fact = fact * n;
n--;
}

printf("Factorial of the nmber is %d\n",fact);


}





No comments:

Post a Comment