Write a program to determine the factorial of 4 numbers
#include<iostream>
using namespace std;
int main() {
int num,factorial=1;
cout<<" Enter number to find its factorial: ";
cin>>num;
for (int i=1;i<=num;i++) {
factorial*=i;
}
cout<<"Factorial of Number is = "<<factorial<<endl;
cin>>num;
return 0;
}
Comments
Leave a comment