O'Reilly logo

Sams Teach Yourself C++ in One Hour a Day, Seventh Edition by Siddhartha Rao

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Lesson 5. Working with Expressions, Statements, and Operators

At its heart, a program is a set of commands executed in sequence. These commands are programmed into expressions and statements and use operators to perform specific calculations or actions.

In this lesson, you learn

• What statements are

• What blocks or compound statements are

• What operators are

• How to perform simple arithmetic and logical operations

Statements

Languages—spoken or programmed—are composed of statements that are executed one after another. Let’s analyze the first important statement you learned:

cout << "Hello World" << endl;

A statement using cout displays text using the console on the screen. All statements in C++ end with a semicolon (;), which defines the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required