How can I replace this code with one if statement?

  c++

How can I replace this code with only one if statement?

unsigned int x, y;
cin>>x;
if((x>=0)&&(x<=1)) y = 1;
else if (x<=3) y = 2;
    else if(x<=5) y = 3;
        else y = 6;

Source: Windows Questions C++

LEAVE A COMMENT