a question about if

 

hey guys, i could not find my answer in doc.

what if we have 2 things to do when the condition has met?


for example:

if (x>Y)

Print (x) && x++;

this gives me error.

i mean if the condition is true do both of them, if its not do none of them.

thanks

 
Birkimson Varzxorani:

hey guys, i could not find my answer in doc.

what if we have 2 things to do when the condition has met?


for example:

if (x>Y)

Print (x) && x++;

this gives me error.

i mean if the condition is true do both of them, if its not do none of them.

thanks

enclose the statements that need to be grouped in curly brackets {}

   if(x > y)
   {
      Print("hello world");
      x++;
   }
 
Paul Anscombe:

enclose the statements that need to be grouped in curly brackets {}

problem solved. thanks pal
 
Birkimson Varzxorani:
problem solved. thanks pal
You are welcome 
Reason: