1.

Identify the error in the following code :switch (c){case 9.0 : a = a + 2;break;case 8.0 :a = a + 3;break;} 

Answer»

Variable ‘c’ cannot be of float/real data type. Note: Full 1 mark should be allotted if correct code is written

Detailed Answer :

Default case is missing in the given code which is used for performing a task when none of the cases are true.



Discussion

No Comment Found

Related InterviewSolutions