~ Arithmetic operators :
+ + (Unary Plus)
- - (Unary minus)
+ (Addition)
- (Substraction)
* (multiplication)
/ (Floating-point division / Integer division)
% (Modulus)
Dlm C++, ade increament nan decrement operator..
+ + (Pre-increment) e.g + +m
+ + (Post-increment) e.g m+ +
- - (Pre-decrement) e.g - -n
- - (Post-decrement) e.g n- -
Tips utk sng hfl : if simbol at dpn variable (Pre-), mest TAMBAH or TOLAK 1.. if simbol at blkng (Post-) xyah tmbah pe2..follow je blek soalan..
EXAMPLE
a = 2 , b = 3
m = 2 , n = 3
p = 2 , q = 3
x = 2 , y = 3
(+ + a) + (- - b) * 4 > (+ + m) * (- - n) + 4
JAWAPAN :
2) Relational operators :
< (Less than)
> (Greater than)
= = (Equal to)
< = (Less than or equal to)
> = (Greater than or equal to)
! = (Not equal to)
3) Logical operators : (0/False , 1/True)
& & (AND) ----> IF 0 mest FALSE
| | (OR) ----> IF DE 1 MEST TRUE
! (NOT) ---->IF 1, MEST 0..IF 0, MEST 1
!(& &) (NOT AND) ----> MEST TBALEK KN & &
!(| |) (NOT OR) ----> jwpn tbalek nan | |
EXAMPLE
No comments:
Post a Comment