Professional Documents
Culture Documents
•Arithmetic operators
•Assignment operators
•Comparison operators
•Logical operators
•Bitwise operators
Arithmetic Operators
• Arithmetic operators are used to perform common
mathematical operations.
C++ Assignment Operators
• int x = 10;
A list of all assignment operators:
C++ Comparison Operators
• Comparison operators are used to compare two values:
C++ Logical Operators
• Logical operators are used to determine the logic between variables
or values:
Exercise
Use the following value of x = 10, y=5
1.x+y =_____ 7.y-- =_____
2.x-y =_____ 8.x+=4 =_____
3.x*y =_____ 9.y*=5 =_____
4.x/y =_____ 10.y/=5 =_____
5.x%y =_____
6.x++ =_____
Answer the following:
Write only TRUE or FALSE.
Use the given value: x=5, y=8, z=12, m=-5, b=6, c=7
1. x!=y 7. b>x && y>m
2. x==m 8. c<b ||z<y
3. y<m 9. !(y<z&&m<b)
4. m<y 10.!(b>x||z>c)
5. x<=m
6. y>=5