Question for IF

 

Dear friends ,

 

i have a question for "if" and it would be great if you help me

 

is it correct to write something like this?

 

if((A1>100 && A2<100) || (B1>100 && B2<100));
 
Yes
 
GumRai:
Yes


Thank you, 

 

what about this one? should be ok , right?

if((A1>100 || A2<100) && (B1>100 || B2<100));
 
yes
 
Regarding the brackets, it might also be worth having a quick read through the precedence rules
 

Use of () is recommended.

You can also write this way to make your code clearer:

if(   ( A1>100 || A2<100 )
   && ( B1>100 || B2<100 ) 
  ) ...