Computer Science, asked by lilygracetopno28, 3 months ago

write a programme in c++ to find the factorial of a number using class and object.​

Answers

Answered by mahesijjh
0

Program:

#include <iostream>

using namespace std;

int main()

{

int i,fact=1,number;

cout<<"Enter any Number: ";

cin>>number;

for(i=1;i<=number;i++){

fact=fact*i;

}

cout<<"Factorial of " <<number<<" is: "<<fact<<endl;

return 0;

}

Similar questions