ប្រតិបត្តិ៖ ហ្វាក់តូរីយែល
ហ្វាក់តូរីយែល
Factorial
//Factorial
#include<iostream>
using namespace std;
int main( )
{
int i,fact=1,num;
cout<<"Enter any Number: ";
cin>>num;
for(i=1;i<=num;i++)
{
fact=fact*i;
}
cout<<"Factorial of "<<num<<" is "<<fact;
getchar();
return 0;
}
#include<iostream>
using namespace std;
int main( )
{
int i,fact=1,num;
cout<<"Enter any Number: ";
cin>>num;
for(i=1;i<=num;i++)
{
fact=fact*i;
}
cout<<"Factorial of "<<num<<" is "<<fact;
getchar();
return 0;
}
Comments
Post a Comment