#include<iostream.h>
class factorial
{
public:
int count,n,fact;
public:
void fun()
{
cout<<"Enter The No. :\n";
cin>>n;
count=1;
fact=1;
while(count!=n)
{
count++;
fact = fact * count;
}
cout<<"Factorial Value is :\n"<<fact<<endl;
}
};
main()
{
class factorial f1;
f1.fun();
}
class factorial
{
public:
int count,n,fact;
public:
void fun()
{
cout<<"Enter The No. :\n";
cin>>n;
count=1;
fact=1;
while(count!=n)
{
count++;
fact = fact * count;
}
cout<<"Factorial Value is :\n"<<fact<<endl;
}
};
main()
{
class factorial f1;
f1.fun();
}
0 comments:
Post a Comment