Computer Science, asked by ranabarsha152, 3 months ago

write a program to find the Factorial of a number using class and Object​?

Answers

Answered by samfernando342
3

Answer:

#include<stdio.h>

int main()

{

int i,fact=1,number;

printf("Enter a number: ");

scanf("%d",&number);

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

fact=fact*i;

Answered by tanujagautam107
1

Answer:

Explanation:

#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