UGC NET June-2019 CS Paper-2
October 21, 2023UPPCL AE 2022
October 21, 2023NTA UGC NET DEC-2022 Paper-2
Question 4 |
Consider the following conditional code, which returns a Boolean values
if ((x>25) && (y>100))
return ‘false’;
else if((x<=25) && (y<=100)
return ‘true’;
else if((x>25) && (y<=100)
return ‘false’;
else
return ‘true’;
if ((x>25) && (y>100))
return ‘false’;
else if((x<=25) && (y<=100)
return ‘true’;
else if((x>25) && (y<=100)
return ‘false’;
else
return ‘true’;
simplify it by filling in the following blank with a single Boolean expression without changing the behaviour of the conditional code.
if( ………..)
return ‘true’;
else
return ‘false’;
x>25 | |
x<=25 | |
y>100 | |
y<=100 |
Question 4 Explanation:
According to given conditions, if x value is < = 25 means it will return true and for other values it will return false.
Alone y<=100 won’t return true, it should be along with x<=25
Alone y<=100 won’t return true, it should be along with x<=25
Correct Answer: B
Question 4 Explanation:
According to given conditions, if x value is < = 25 means it will return true and for other values it will return false.
Alone y<=100 won’t return true, it should be along with x<=25
Alone y<=100 won’t return true, it should be along with x<=25
Subscribe
Login
0 Comments