0
Factorial
To make a factorial would I need a for or can I do it without?
1 Answer
0
this is my code
#include<iostream>
using namespace std;
void main (){
int number;
int factorial =1;
cout<<"please enter the number:";
cin>>number;
for(int i=1;i<=number;i++)
factorial*=i;
cout<<"the factorial of the entered number=";
cout<<factorial;
}