if (x==1) { // do something if x is 1 y = const.pi; else if (x == 2) { // do something if x is 2 y = sin(const.pi*(1-x)) / (1-x); else // do something in all the other cases y = rand(); }}