हिंदी

Find errors in the following snippet: int p = 10; switch (p) { case1: q = p * 2; break; case2: q = p + 2; break; case3: q = p − 2; break; } - Computer Applications

Advertisements
Advertisements

प्रश्न

Find errors in the following snippet:

int p = 10; 
switch (p) 
{
case1: q = p * 2; 
break; 
case2: q = p + 2;
break; 
case3: q = p − 2; 
break; 
}
संक्षेप में उत्तर

उत्तर

  1. No execution takes place as the value of p = 10.
  2. The variable q is not declared. 
shaalaa.com
  क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
अध्याय 1.08: Conditional Statements in Java - Review Insight [पृष्ठ ९७]

APPEARS IN

अविचल Computer Applications [English] Class 10 ICSE
अध्याय 1.08 Conditional Statements in Java
Review Insight | Q 5. (b) | पृष्ठ ९७
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×