Q2 Write a c program to find the factorial value of any number entered through the keyboard.
Program: 95
Write a c program to find the factorial value of any number entered through the keyboard.
Output:
Enter a number: 5 The Factorial for 5 is 120
Write a c program to find the factorial value of any number entered through the keyboard.
Enter a number: 5 The Factorial for 5 is 120
why you put conio.h in every program
Some old compilers doesn’t support console input/Output without conio.h header files. It’s not a part of standard library.
It’s my habit, you can ignore it because modern compiler doesn’t need conio.h.
and Thanks for choosing EasterScience
did you checked our COVID-19 Tracker
//it can be done in this way also?
#include<stdio.h>
main()
{
int num,i,n=1;
printf(“enter a number”);
scanf(“%d”,&num);
for(i=1;i<=num;i++)
{
n=n*i;
}
printf(“fectorial is %d”,n);
}