Question #308840

Write a program in C++ to display the cube of the lowest integer up to the number the user will enter. You may use any type of loop that suits to solve the problem.

Expert's answer



#include <iostream>
#include <string>


using namespace std;






int main() {


	int number;


	cout<<"Enter number: ";
	cin>>number;


	for(int i=1;i<=number;i++){
		cout<<i<<"^3 = "<<(i*i*i)<<"\n";
	}


	system("pause");
	return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

LATEST TUTORIALS
APPROVED BY CLIENTS