if structure

Can i add more conditions to the if structure?
Like - if(condition)(condition)..
if ( condition and|or other condition )

and ( && ) if you need to execute the if body only when both are true
or ( || ) if you need to execute it when at least one of the condition is true
Last edited on
Yes, using the && (and), || (or) logical operators.
Yap something like:
1
2
3
4
5
6
7
8
if (a<b && a<c){

s = a+b-c;
}
if (a<b && a>c) {

s=a-b+c;
}


you can do the same with || (or) operator

:)
Topic archived. No new replies allowed.