switch(x){ case(0): //if x == 0 //do some stuff break; //add more cases default: //when x does not match any case //do some stuff break; }