Input Headers 1#include <iostream> User input 1 2 3int age; std::cout << "How old are you? "; std::cin >> age; User input (Handling error) 1 2 3 4 5std::cout << "How old are you again? "; if (!(std::cin >> age)) { std::cout << "There is an error in your input\n"; return 1; } Consuming input 1 2 3 4 5 6if (age >= 18) { std::cout << "Welcome!\n"; } else { std::cout << "Sorry.\n"; return 1; } Share Snippets