Software Engineer, Your next Programming Instructor.

"Here I share myself."

Tuesday, 25 February 2020

Program for factorial of a number C++

factorial c++ function,factorial c++ example,factorial c++ code,c++ factorial of a number,factorial of a number c++ program

Factorial Program in C++ | C++ Program to find factorial of a number

#include<iostream.h>
#include<conio.h>
class Temp{
public:
Fact()
{
int num,fact=1;
cout<<"Enter the number to find out Factorial! ";
cin>>num;
for(int i=num;i>0;i--)
fact=fact*i;
cout<<"Factorial is "<<fact;
}
};
void main()
{
Temp obj;
obj.Fact();
}

No comments: