Logical OR operator

Current Categories - C-programming
 
*Logical OR operators – The operator symbol is ' || '.

->The statement is considered as true,when any one of the expressions or statements are true.

*Truth table -
A B A&&B
0 0    0
0 1       1
1 0       1
1 1       1

e.g -      Consider p=10, q=20 ,r=30 ,s=40
  • e=p>q && r>s then e will be zero or false.
  • e=p>q && r<s then e is true or 1.
  • e=p<q && r>s then e is true.
  • e=p<q && r<s then e is true.

copyright@
MyFreeCopyright.com Registered & Protected
facebook-logo