hi frnds!!
i have d code for series
x^!+x^2+x^3+....x^m
with single loop only
//wap to find sum of series and print series also
//x+x^2+x^3+......x^n
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int n,x,count1;
int sum=0;
cout<<"enter a number";
cin>>x;
cout<<"enter nth term till which u want to compute";
cin>>n;
int count=1;
for(int i=1;i<=n;i++)
{
count=count*x;
cout<<count;
cout<<" "<<"+"<<" ";
sum+=count;
}
cout<<"sum of series is="<<sum;
getch();
}
so enjoy!!
nd give ur comments if u like it...