# Help me in solving BMCCP06 problem

### My issue

please explain the conditional statement put in line 13 and 14

### My code

``````// Update the '_' in the code below to solve the problem

#include <stdio.h>

int main() {
int t;
scanf("%d", &t);
for (int i = 0; i < t; i++) {
int A, B;
scanf("%d %d", &A, &B);

// Declare variables for lower and higher of the 2 numbers
int minAB = A < B ? A : B;
int maxAB = A > B ? A : B;
int flag = 0;

while (minAB <= maxAB) {
// Condition is met, hence set flag = 1
if (minAB == maxAB) {
flag = 1;
break;
}
else {
// Update the minimum value as per the problem statement
minAB *= 2;
}
}

if (flag == 1) {
printf("YES\n");
}
else {
printf("NO\n");
}
}
return 0;
}

``````

Learning course: Beginner DSA in C
Problem Link: CodeChef: Practical coding for everyone

Here what we have used is called a “ternary operator”.
Basically it is something like this -
( (condition) ? (expression_A) : (expression_B) )
So if the “condition” becomes true then the whole thing is replaced by “expression_A”, otherwise it is replaced by “expression_B”
By whole thing I mean everything inside the outer parentheses.
So when we write-

``````int minAB = A < B ? A : B;
``````

it means check if A < B. If so, then entire right hand side becomes A (expression_A in our example), basically value of A gets assigned to minAB. If condition (A<B) is false the same thing happens with B.