Give an input statement that will fill the variable the_number (of type int) with a number typed in at the keyboard. Precede the input statement with a prompt statement asking the user to enter a whole number.
The following "cout" statement is used to a prompt statement asking the user to enter a whole number and "cin" input statement that will read the variable the_number (of type int) with a number typed in at the keyboard:
int the_number;
cout <<"Enter a whole number and press return: ";
cin >> the_number;
Complete executable program code:
#include <iostream>
using namespace std;
int main()
{
//Declare the variable name, 'the_number'
//along with the data type is int
int the_number;
//Prompt input statement as asking the user
//to enter a whole number.
cout <<"Enter a whole number: ";
//Read input from the user
cin >> the_number;
return 0;
}
Output of the program code:
Note: Only read the input value from the user by promptin of statement.
Enter a whole number: 500