Example 1:


while(condition){
int x=someIntegervalue;
}
PRINT x; // What should happen? Of course Error. Coz x is not outside while, in this case.

Example 2: