Curioustab
Aptitude
General Knowledge
Verbal Reasoning
Computer Science
Interview
Aptitude
General Knowledge
Verbal Reasoning
Computer Science
Interview
Home
»
C# Programming
»
Control Instructions
Which of the following is another way to rewrite the code snippet given below? int a = 1, b = 2, c = 0; if (a < b) c = a;
int a = 1, b = 2, c = 0; c = a < b ? a : 0;
int a = 1, b = 2, c = 0; a < b ? c = a : c = 0;
int a = 1, b = 2, c = 0; a < b ? c = a : c = 0 ? 0 : 0;
int a = 1, b = 2, c = 0; a < b ? return (c): return (0);
int a = 1, b = 2,c = 0; c = a < b : a ? 0;
Show Answer
Correct Answer:
int a = 1, b = 2, c = 0; c = a < b ? a : 0;
← Previous
Next →
Discussion & Comments
No comments yet. Be the first to comment!
Name:
Comment:
Post Comment