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