Programming Language Syntax

If the variable name is 'age' and the programmer wants to input age, which is the correct syntax?

Answer: cin>>age;
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.

This question appeared in Past Papers (6 times)
ETEA 25 Years Past Papers Subject Wise (Solved) (2 times)
KPK Teacher Past Papers SST PST CT TT PET (2 times)
Secondary School Teacher SST Past Papers, Syllabus, Jobs (2 times)
This question appeared in Subjects (1 times)

Install this app on your device for quick access right from your home screen.