Consider the given expression:

not True and False or True

Which of the following will be correct output if the given expression is evaluated?

(a) True

(b) False

(c) NONE

(d) NULL

 

Answer:

On evaluating the given expression -Teachoo.png

On evaluating the given expression, the output given is True .

So, the correct answer is (a).

 

Explanation:

And, or and not are the three logical operators in the above expression.

The truth tables for the 3 operators are:

a. and

[MCQ] Consider the given expression: not True and False or True - CBSE Class 12 Sample Paper for 2023 Boards

b. or

part 2 - Question 4 - CBSE Class 12 Sample Paper for 2023 Boards - Solutions to CBSE Sample Paper - Computer Science Class 12 - Computer Science - Class 12

c. not

part 3 - Question 4 - CBSE Class 12 Sample Paper for 2023 Boards - Solutions to CBSE Sample Paper - Computer Science Class 12 - Computer Science - Class 12

Evaluating the given expression:

Step 1: not True gives False. So the expression becomes ‘ False and False or True ’.

Step 2: False and False give False. So the expression becomes ‘ False or True ’.

Step 3: False or True gives True. So the expression becomes ‘ True’.

 

Therefore, the output will be True if the given expression is evaluated.

Remove Ads
Davneet Singh's photo - Co-founder, Teachoo

Made by

Davneet Singh

Davneet Singh is an IIT Kanpur graduate and has been teaching for 16+ years. At Teachoo, he breaks down Maths, Science and Computer Science into simple steps so students understand concepts deeply and score with confidence.

Many students prefer Teachoo Black for a smooth, ad-free learning experience.