[amp_mcq option1=”cin << currentPay;" option2="cin >> currentPay;” option3=”cout << currentPay;" option4="cout >> currentPay; E. None of the above” correct=”option2″]
The correct answer is B. cin >> currentPay.
The statement cin >> currentPay reads a value from the keyboard and stores it in the variable currentPay. The cin object is a stream object that is used to read input from the keyboard. The >> operator is a stream insertion operator that is used to read a value from the keyboard and store it in a variable.
The statement cout << currentPay writes the value of the variable currentPay to the screen. The cout object is a stream object that is used to write output to the screen. The << operator is a stream insertion operator that is used to write a value to the screen.
The statement cout >> currentPay is not valid. The >> operator is a stream insertion operator, not a stream extraction operator. Stream insertion operators are used to write values to the screen, while stream extraction operators are used to read values from the keyboard.
The statement None of the above is also not correct. The statement cin >> currentPay is the only statement that allows the user to enter data at the keyboard.