I have been working on a problem to enter the first term then a second term.... then add all of the numbers

for example..

enter first term: 1

enter second term: 5

output

1+2+3+4+5 = 14

I was able to get that to work correctly...

now I am trying to do the second half of the program...

to output

1*1*1 + 2*2*2 + 3*3*3 + 4*4*4 + 5*5*5 = answer

this is what i have so far... I think I have the right idea but something like a bracket in the wrong place or maybe too many places

#include<iostream.h>

#include<math.h>

main()

{

int firstnum, secondnum, answer;

int total = 0;

int total2 = 0;

cout<<"Please enter beginning term: ";

cin>>firstnum;

cout<<"Please enter ending term: ";

cin>>secondnum;

while(firstnum<=secondnum)

{

{

cout<<firstnum<<" + ";

total=(total+firstnum);

firstnum++;

}

cout<<" = "<<total<<"\n";

{

cout<<firstnum<<" * " << firstnum<<" * "<<firstnum;

total2 = (firstnum * firstnum * firstnum);

firstnum++;

}

cout<<" = "<<total2<<"\n";

}

}

when i compile I get an error.... expecting a bracket....

suggestions would be appreciated.

thank you

marie10913@aol.com