9.7k views
5 votes
) Using newline command : endl

#include

using namespace std; int main()

{

cout << "My first C++ program." << endl;

cout << "The sum of 2 and 3 = " << 5 << endl; ..............................Output

cout << "7 + 8 = " << 7 + 8 << endl;

return 0;

}

User Dalzhim
by
4.8k points

1 Answer

6 votes

Answer:

The output of the code is following:-

My first C++ program.

The sum of 2 and 3 = 5

7 + 8 = 15

Step-by-step explanation:

First the program should have #include<iostream>.This is missing in the program.

In the program you have printed My first C++ program first then used newline character endl. After that you have printed The sum of 2 and 3 = 5 this will be printed in the new line.Then you have used endl.Then printed "7 + 8 = " string and the sum 7+8 that is 15.

Hence the output is like this.

User Johnnycrab
by
5.1k points