There must be two variables for example A and B, these two will either take the values 0 0, 0 1 , 1 0 or 1 1. I need to check these two variables and return a value between 0 to 3, is there a better way to this than doing four if statements like:
if(B == 0 && A == 0){
return 0;
}
if(B == 0 && A == 1){
return 1;
}
if(B == 1 && A == 0){
return 2;
}
if(B ==1 && A == 1){
return 3;
}