C PROGRAMMING

wirte a c program to print factorial of a given number

#include <stdio.h>
#include <conio.h>
main() {
int n, i,factorial=1;
printf("Enter any number: ");
scanf("%d",&n);
for (i=n;i>=1;i--)
{
factorial = factorial*i;
}
printf("Factorial is: %d",factorial);
getch();
}
Show More

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button