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.
For using a variable in C++, we have to first define it to tell the compiler about its existence so that compiler can allocate the required memory to it.
AGM 24-12-2022
Get instant updates and alerts directly from our site.
Install this app on your device for quick access right from your home screen.