Use app×
Join Bloom Tuition
One on One Online Tuition
JEE MAIN 2025 Foundation Course
NEET 2025 Foundation Course
CLASS 12 FOUNDATION COURSE
CLASS 10 FOUNDATION COURSE
CLASS 9 FOUNDATION COURSE
CLASS 8 FOUNDATION COURSE
0 votes
56 views
in Computer by (44.9k points)
closed by

And operator.

1 Answer

+1 vote
by (44.8k points)
selected by
 
Best answer

AND operator is used to determine if two or more conditions are true. If all the conditions are true, the AND operator returns TRUE. If any one of the conditions fail, the AND operator returns FALSE. In some programming languages AND operator is denoted by “&&” symbol.

For example - you should go to bed only after you have completed your homework and the time is past 8 PM.

Here, if we want to derive the logical operation from this scenario, we have the following conditions:

Condition 1: Have you completed homework? 

Condition 2: Is the time past 8 PM?

And the decision we are deriving is: 

Decision: Should you go to bed? 

Based on this we can write the below pseudo code:

IF (Homework completed) AND(Time is past 8 PM) 
THEN 
  Go to bed 
ELSE 
  Do not go to bed 
END

Let us now try to see the different combinations possible with the above pseudo code.

Condition 1 Condition 2 Decision
Have you completed homework? Is the time past 8 PM? Should you go to bed?
Yes Yes Yes
No Yes No
Yes No No
No No No

Welcome to Sarthaks eConnect: A unique platform where students can interact with teachers/experts/students to get solutions to their queries. Students (upto class 10+2) preparing for All Government Exams, CBSE Board Exam, ICSE Board Exam, State Board Exam, JEE (Mains+Advance) and NEET can ask questions from any subject and get quick answers by subject teachers/ experts/mentors/students.

Categories

...