...
UGC NET June-2019 CS Paper-2
October 21, 2023
UPPCL AE 2022
October 21, 2023
UGC NET June-2019 CS Paper-2
October 21, 2023
UPPCL AE 2022
October 21, 2023

NTA 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’;

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’;

A
x>25
B
x<=25
C
y>100
D
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
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
0 0 votes
Article Rating
Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x
error: Alert: Content selection is disabled!!