Compare the diffrences

What's the difference between putting " } " in different place?

This is my code.

int num=0 ;
int led=13;
int flash=100;
void setup() 
{
  Serial.begin(9600);
  pinMode(led,OUTPUT);
  //digitalWrite(led,LOW);  
}

void loop()
{
  if(Serial.available()>0)
  {
     num=Serial.read();
     num=num-'0' ;                
     if(num>=0 && num<=9)
     {
        if(num==0)
        
          flash=1000;
        
        else
        
          flash=num*100;
        
     }  
  }                                            // 1.
     digitalWrite(led,HIGH);
     delay(flash);

     digitalWrite(led,LOW);
     delay(flash);
  }                                            // 2.                                                     
}

If you put it at 1, then the if( Serial.available() ) statement ends there.

If you put it at 2, then the if( Serial.available() ) statement ends there.

The effective difference, is that the four lines of code which cause the flashing, will execute once every time through loop( ) with 1,

but with 2, they will only execute if ( Serial.available() ) is true.