blob: 0fc25f8328a8ec9fc90a99416d089d2576409a59 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
|
#include <iostream> // for std::cout and std::cin
int main()
{
std::cout << "Enter a number: "; // ask user for a number
int x{}; // define variable x to hold user input (and value-initialize it)
std::cin >> x; // get number from keyboard and store it in variable x
std::cout << "You entered " << x << '\n';
return 0;
}
|