Input and output using cin and cout
📖 Scenario: You are creating a simple program that asks a user for their name and age, then shows a greeting message with that information.
🎯 Goal: Build a program that reads a user's name and age using cin and then prints a greeting message using cout.
📋 What You'll Learn
Use
string to store the user's nameUse
int to store the user's ageUse
cin to get input from the userUse
cout to display the greeting message💡 Why This Matters
🌍 Real World
Getting input from users and showing messages is the first step in making interactive programs like games, calculators, or forms.
💼 Career
Understanding basic input and output is essential for any programming job because it helps you communicate with users and test your programs.
Progress0 / 4 steps