Day 23

Many Statements

Most C++ programs contain many statements.

The statements are executed, one by one, in the same order as they are written:

Example

cout << "Hello World!";

cout << "Have a good day!";

return 0

Example explained

From the example above, we have three statements:

  1. cout << "Hello World!";
  2. cout << "Have a good day!";
  3. return 0;

The first statement is executed first (print "Hello World!" to the screen).

Then the second statement is executed (print "Have a good day!" to the screen).

And at last, the third statement is executed (end the C++ program successfully).

Comments

Popular posts from this blog

Day 2 Talking about computer science 💻

Day 5💻

Day 12 “C comments”