d) Identify the error in the following snippet and correct it
String res=if(mark>40 && mark<=100)?pass:fail;
[2]
Answers
Answered by
1
Answer:
Since it is the ternary operator........
Correct answer is
String res=(mark>40 && mark<=100)?pass:fail;
Similar questions