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:
cout << "Hello World!";cout << "Have a good day!";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
Post a Comment