217k views
4 votes
If the following statement were in a C++ program, what would it do?

cout >> "I love oranges and apples";

1 Answer

6 votes

Answer:

It will show compilation error like - no match for 'operator>>'

Step-by-step explanation:

<< and >> are input output stream operators which are used with different input output stream objects in C++. So << operator is used to output stream of characters to console or a file and >> operator is used to input or read some characters or integers from a file or console. Here input stream character is used with output stream object cout, which produces an error.

User Giulio Pettenuzzo
by
4.8k points