factorial of Number in C++:
if a number is given for example 3, the factorial of number 3 is 3*2*1 which means 6.
The logic of the program:
The logic of the program is very easy. the given value is assigned in a variable name
n. For loop end with 1, not a 0, it increases the element till the ‘n’ number and both the
elements are multiply 1*2*3 = 6.
#include< iostream.h >
using namespace std;
cout<<"Enter the positive numbers";
cout <<"factorial of the number is %d" << fact ;