c 2b 2b keyboard input

Solutions on MaxInterview for c 2b 2b keyboard input by the best coders in the world

showing results for - "c 2b 2b keyboard input"
Isabel
15 Sep 2019
1#include <iostream>  // for std::cout and std::cin
2 
3int main()
4{
5    std::cout << "Enter a number: "; // ask user for a number
6 
7    int x{ }; // define variable x to hold user input (and zero-initialize it)
8    std::cin >> x; // get number from keyboard and store it in variable x
9 
10    std::cout << "You entered " << x << '\n';
11    return 0;
12}
13
14Enter a number: 4
15You entered 4
16