I'll discuss this further in Section 3 . Except for a few minor details that you will probably never encounter in practice, they are the same as in Java. The same goes for assignment statements and expressions. One difference, already noted above, is that the mathematical functions are not contained in a Math class. The standard input stream is called cin , and the standard output stream is called cout .
Output is similar, except that the direction of the arrows is reversed.
The access modifiers public , private , and protected cannot be used outside classes. The static modifier can be used both inside and outside classes, but outside a class, it has a completely different meaning than it does inside a class. The exact form of the main routine is not entirely standardized, and often several forms are acceptable. In some cases, for example, the main routine has return type void , while in other cases, it has return type int . On a given system, either or both of these formats might be acceptable.