Program Code:
#include<iostream>
using namespace std;
int main()
{
int fact =1 ,n;
cout<<"Enter Range A : ";
cin>>n;
cout<<"\n\n";
cout<<"A\t\tFactorial A\n\n";
for(int i =1;i<n;i++)
{
for(int j=1;j<=i;j++)
{
fact = fact * j;
}
cout<<i<<"\t\t"<<fact;
cout<<endl;
fact = 1;
}
return 0;
}
Output:
.exe file |
No comments:
Post a Comment