I need a user to enter two numbers. Then the output needs to show the square and cube of those number. If the numbers are spread apart, 1 and 3 for example, then the numbers between them need to show as well.
So 1 and 3 would show
Number Square Cube
1 1 1
2 4 8
3 9 27
My problem is I can't get the thing to show all the numbers in between correctly. please check my code and tell me what I should look at. I'm a complete beginner so please go easy on me. Thanks.
Here's what I got...
int main ()
{
//declare variables
int first = 0;
int second = 0;
double totalNum = 0.0;
double squareFirst = 0.0;
double cubeFirst = 0.0;
double squareSecond = 0.0;
double cubeSecond = 0.0;
//enter input items
cout << "Enter your first number:" << endl;
cin >> first;
cout << "Enter another number greater than the first:" << endl;
cin >> second;