0% found this document useful (0 votes)
60 views

14-08-23 Kishore Sir Sent by Mistake Wrong Notes

Uploaded by

Amol Shinde
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
60 views

14-08-23 Kishore Sir Sent by Mistake Wrong Notes

Uploaded by

Amol Shinde
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

Logical operators [ &&, || , !

]:
&&, || used to combine two or more expressions into a
single expression.
! operator for negation. i.e. true becomes false and false
becomes true.
Note: In C compiler 0 means false and other than 0
anything is true i.e. 1.
Truth tables:
Operator Expression1 Expression2 Result
&& - and True – 1 True – 1 1
1 0 0
0 1 0
0 0 0
|| - or 1 1 1
1 0 1
0 1 1
0 0 0
!true – false
!false - true
Increment && decrement /modify operators [ ++ / -- ]:
They are used to increment or decrement a variable value by 1.
Eg:

Int a=4, b=8;

a++; i.e. a=a+1  a=5


b--; i.e. b=b-1  b=7
Note: Until assigning to any other variable, pre and post operations are same.

You might also like