print('if statement');
if (2>1)
    print('2>1');

print('if and else statements');
x=2; y=3;
if (x>y)
    print(x+'>'+y);
else
    print(x+'<='+y);

print('for loop');
for (i=0; i<5;i++)
    print(i);

print('while loop');
var i=0;
while (i++<5)
   print(i);

print('do loop');
var i = 1;
do {
    print(i++);
} while (i<=5);

print('nested for loops');
for (i=0;i<2;i++) 
   for (j=0;j<2;j++) 
      print(i+" "+j);

print('for + if');
for (i=0; i<5; i++) 
    if (i<2)
        print(i+': i<2: ');
    else
       print(i+': i>=2: ');

print('for + while');
for (i=0,j=0; i<5; i++) {
     while (j++<2) {
        print(i+' '+j);
    }
}

print('for + do');
j = 0;
for (i=0; i<2; i++) {
     do {
          print(i+' '+j);
     } while (j++<2);
}

print("nested ifs");
var i = 10; j = i+1;
if (i==10) {
    print(" if 1");
    print(" if 2");
    if (i==j) {
        print("    nested if 1");
        print("    nested if 2");
    }
}
