summaryrefslogtreecommitdiffstats
path: root/src/chapter1/lesson5/multiple_cin.cpp
blob: 991e3978c48e12e2cd695ef14a095230bc3ef4e6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include <iostream>  // for std::cout and std::cin

int main()
{
    std::cout << "Enter two numbers separated by a space: ";

    int x{}; // define variable x to hold user input (and value-initialize it)
    int y{}; // define variable y to hold user input (and value-initialize it)
    std::cin >> x >> y; // get two numbers and store in variable x and y respectively

    std::cout << "You entered " << x << " and " << y << '\n';

    return 0;
}