Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

C++

Bitwise Operators .......................................................................................................................................... 39

Assignment Operators ................................................................................................................................... 41

Misc Operators .............................................................................................................................................. 44

Operators Precedence in C++ ......................................................................................................................... 45

12. LOOP TYPES......................................................................................................................... 48

While Loop .................................................................................................................................................... 49

Loop Control Statements ............................................................................................................................... 57

The Infinite Loop ............................................................................................................................................ 63

13. DECISION-MAKING STATEMENTS ........................................................................................ 65

If Statement ................................................................................................................................................... 66

if…else Statement .......................................................................................................................................... 67

if...else if...else Statement ............................................................................................................................. 69

Switch Statement .......................................................................................................................................... 71

Nested if Statement ....................................................................................................................................... 73

The ? : Operator ............................................................................................................................................. 76

14. FUNCTIONS ......................................................................................................................... 77

Defining a Function ........................................................................................................................................ 77

Function Declarations .................................................................................................................................... 78

Calling a Function .......................................................................................................................................... 78

Function Arguments ...................................................................................................................................... 80

15. NUMBERS ........................................................................................................................... 87

Defining Numbers in C++ ............................................................................................................................... 87

Math Operations in C++ ................................................................................................................................. 88

Random Numbers in C++ ............................................................................................................................... 90

16. ARRAYS ............................................................................................................................... 92

Declaring Arrays ............................................................................................................................................ 92

iv

You might also like