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;
- The condition no < 11 will be evaluated only if age > 18 evaluates to True.
- The statement a = 25 will get executed if any one condition is True.
- The condition no < 11 will be evaluated only if age > 18 evaluates to False.
- The statement a = 25 will get executed if both the conditions are True.
- && is known as a short circuiting logical operator.
Discussion:
2 comments Page 1 of 1.
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;
if(Expression1&&Expression2)
code;
Madusha Rathnayake said:
6 years ago
Why && is known as a short-circuiting logical operator?
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers