Computer Science - Class 12
Solutions to CBSE Sample Paper - Computer Science Class 12

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

Question 4 a -Teachoo.png

b. or

Question 4 b -Teachoo.png

c. not

Question 4 c -Teachoo.png

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.

Ask a doubt
Davneet Singh's photo - Co-founder, Teachoo

Made by

Davneet Singh

Davneet Singh has done his B.Tech from Indian Institute of Technology, Kanpur. He has been teaching from the past 14 years. He provides courses for Maths, Science, Social Science, Physics, Chemistry, Computer Science at Teachoo.