Lab 1

2/9/05

Task: Write a program that asks the user for an integer and prints out the cube of that integer.

Purpose: The purpose of this program is primarily to get you used to reading in input from the user, storing that input in a variable, and then manipulating the value of that variable.


Solution:


#include <iostream>

using namespace std;

int main()
{
	int	x;

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

	cout << "The cube of " << x << " is " << x*x*x << endl;
}