C# Programming - Control Instructions - Discussion

Discussion Forum : Control Instructions - General Questions (Q.No. 12)
12.
Which of the following statements are correct about the C#.NET code snippet given below?
if (age > 18 && no < 11)
    a = 25;
  1. The condition no < 11 will be evaluated only if age > 18 evaluates to True.
  2. The statement a = 25 will get executed if any one condition is True.
  3. The condition no < 11 will be evaluated only if age > 18 evaluates to False.
  4. The statement a = 25 will get executed if both the conditions are True.
  5. && is known as a short circuiting logical operator.
1, 3
2, 5
1, 4, 5
3, 4, 5
None of these
Answer: Option
Explanation:
No answer description is available. Let's discuss.
Discussion:
2 comments Page 1 of 1.

Madusha Rathnayake said:   6 years ago
Why && is known as a short-circuiting logical operator?

Vinay vemula said:   8 years ago
The logical AND && expression is used to execute the condition when the two expressions given is must be TRUE.

if(Expression1&&Expression2)
code;

Post your comments here:

Your comments will be displayed after verification.