Open SySagar opened 1 year ago
using namespace std; int main() { int i,fact=1,number=5;
for(i=1;i<=number;i++){ fact=fact*i; } cout<<"Factorial of " <<number<<" is: "<<fact<<endl; return 0; }
output: Factorial of 5 is: 120
include
using namespace std;
int main()
{
int i,fact=1,number=5;
for(i=1;i<=number;i++){
fact=fact*i;
}
cout<<"Factorial of " <<number<<" is: "<<fact<<endl;
return 0;
}