Answer to Question #308840 in C++ for Chubby

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.

1
Expert's answer
2022-03-11T07:23:25-0500


#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!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog