Recall & Review
beginner Click to reveal answer
What is
cin used for in C++?cin is used to take input from the user through the keyboard.
beginner Click to reveal answer
What does
cout do in C++?cout is used to display output on the screen.
beginner Click to reveal answer
How do you include the library needed for
cin and cout?You include the <iostream> library at the top of your program using #include <iostream>.
beginner Click to reveal answer
What symbol is used with
cout to send output?The insertion operator << is used to send output to cout.
beginner Click to reveal answer
How do you read an integer value from the user using
cin?Declare an integer variable, then use cin >> variableName; to read the value.
Which header file must be included to use
cin and cout?✗ Incorrect
cin and cout are part of the iostream library.
What operator is used to get input from the user with
cin?✗ Incorrect
The extraction operator >> is used with cin to read input.
How do you print the text "Hello" using
cout?✗ Incorrect
Use cout << "Hello"; to display text.
What will this code do?
int x; cin >> x;
✗ Incorrect
This code reads a value from the user and stores it in the integer variable x.
Which of these is the correct way to output multiple items?
cout << "Age: " << age << endl;
✗ Incorrect
Using multiple << operators in a row is the correct way to output multiple items.
Explain how to take an integer input from the user and then print it using
cin and cout.Think about the steps from declaring a variable to showing it on screen.
You got /4 concepts.
Describe the role of the operators
>> and << in C++ input and output.Focus on what each operator does with cin and cout.
You got /3 concepts.
