Thursday, 28 June 2012

c++ program that calculate the sum of : 1 1 4 8 9 27…….n terms.

#include<iostream.h>

int main()
{
int i,n;

cout<<"Enter nay number :";
    cin>>n;
for(i=1;i<=n;i++)
 
&

; cout<<" "<<i*i<<" "<<i*i*i;

}