===========================================================================
CODING
#include<all.h>
void main()
{
clrscr();
double n=0,SUM=0,i=1,sum=1,q=1;
cout<<"\nEnter number: ";
cin>>n;
while(i<=n)
{
while(q<=i)
{
sum=i*sum;
q++;
}
SUM=sum+SUM;
if(i<n)
cout<<i<<"! + ";
else
cout<<i<<"! = ";
i++;
}
cout<<SUM;
getch();
}
CODING
#include<all.h>
void main()
{
clrscr();
double n=0,SUM=0,i=1,sum=1,q=1;
cout<<"\nEnter number: ";
cin>>n;
while(i<=n)
{
while(q<=i)
{
sum=i*sum;
q++;
}
SUM=sum+SUM;
if(i<n)
cout<<i<<"! + ";
else
cout<<i<<"! = ";
i++;
}
cout<<SUM;
getch();
}
===========================================================================
No comments:
Post a Comment