1#include <iostream>
2
3int getValueFromUser()
4{
5 std::cout << "Enter an integer: ";
6 int input{};
7 std::cin >> input;
8
9 return input;
10}
11
12int main()
13{
14 int x{ getValueFromUser() }; // first call to getValueFromUser
15 int y{ getValueFromUser() }; // second call to getValueFromUser
16
17 std::cout << x << " + " << y << " = " << x + y << '\n';
18
19 return 0;
20}
21