Computer
If the variable name is ‘age’ and the programmer wants to input age, which is the correct syntax?
Show answer
Correct answer: C) cin>>age;
cin >> age; is the correct syntax in C++ to take input from the user and store it in the variable age.
The >> operator is used with cin to extract the input value into the variable.
Explanation
cin >> age; is the correct syntax in C++ to take input from the user and store it in the variable age.
The >> operator is used with cin to extract the input value into the variable.