C# Programming - Control Instructions - Discussion
Discussion Forum : Control Instructions - General Questions (Q.No. 18)
18.
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 get evaluated only if age > 18 evaluates to False.
- The condition no < 11 will get evaluated if age > 18 evaluates to True.
- The statement a = 25 will get evaluated if any one one of the two conditions is True.
- || is known as a short circuiting logical operator.
- The statement a = 25 will get evaluated only if both the conditions are True.
Discussion:
3 comments Page 1 of 1.
Ultron said:
10 years ago
The second condition will get executed even if the age >18 condition is true right?
Then the first statement is wrong!
Then the first statement is wrong!
Rifath_APps said:
9 years ago
Yes, you are correct @Ultron. The first statement is wrong.
Tahsin said:
5 years ago
I think 3, 4 is correct.
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers