41-Write a program to find the factorial of a number.
Program: 41
Write a program to find the factorial of a number.
#include#includevoidmain(){intnum,i,fact=1;printf("Enter any number: ");scanf("%d",&num);for(i=num;i>=1;i--){fact=fact*i;}printf("The factorial of %d is %d.",num,fact);getch();}
Lokesh Kumar: Being EASTER SCIENCE's founder, Lokesh Kumar wants to share his knowledge and ideas. His motive is "We assist you to choose the best", He believes in different thinking.
Leave a Comment