if(m==0|m==1) should be if(m==0||m==1) see the sign of OR its ||