#include #include using namespace std; void addTen(int& n); int main() { int x {0}; cout << "Enter a number: "; cin >> x; if (!cin) { cerr << "Sorry, that wasn't a number.\n"; return EXIT_FAILURE; } //This can change the value of x because n is a reference. addTen(x); cout << "After adding 10, your number is " << x << ".\n"; return EXIT_SUCCESS; } void addTen(int& n) { //n is a reference to x in main n = n + 10; }