#include <iostream.h>
using namespace std;
int main( void )
{
int y;
int x = 3;
int total = 0;
while ( x <= 10 ) {
y = x * x * x;
cout<<y<<endl;
total += y;
++x;
} // end while
Cout<< "The total is: "<< total <<end;
} // end main
#include <iostream>
using namespace std;
int main( void )
{
int y;
int x = 3;
int total = 0;
while ( x <= 10 ) {
y = x * x * x;
cout<<y<<endl;
total += y;
++x;
} // end while
cout<< "The total is: "<< total <<endl;
int pause;
cin>>pause;
return 0;
} // end main
Comments
Leave a comment