Saved Bookmarks
| 1. |
Briefly explain the input and output operators in C++ with their syntax and example. |
|
Answer» 1. Input Operator: Syntax: cin >> variable. Example: The statement cin>> num; is an input statement and causes the program to wait for the user to type in a number. It takes the value from the keyboard and assigns it to the variable on its right. 2. Output Operator: Syntax: cout<< expression or manipulator Example: The statement Cout<< “ the numbers”; It is an output statement and causes the program to print the message on the standard output. |
|