Simplifying if-else conditions

1
2
3
4
5
6
7
if(checkA){
    if(!checkA || checkB){
        if(checkB){
            return true;
        }
    }
}

Which of the following is equivalent to the above piece of a C++ code?

A

1
2
3
if(checkA && checkB){
    return true;
}

B

1
2
3
if(checkA || checkB){
    return true;
}

C

1
2
3
if(!checkA && checkB){
    return true;
}

D

1
2
3
if(!checkA || checkB){
    return true;
}

×

Problem Loading...

Note Loading...

Set Loading...