हिंदी

Predict the output: p = 1 int a = 1, b = 2, c = 3; switch(p) { case 1: a++; case 2: ++b; break; case 3: c--; } System.out.println(a + "," + b + "," + c); - Computer Applications

Advertisements
Advertisements

प्रश्न

Predict the output:

p = 1

int a = 1, b = 2, c = 3; 
switch(p)
   {
   case 1: a++; 
   case 2: ++b;
      break; 
   case 3: c--; 
   }
System.out.println(a + "," + b + "," + c);
एक पंक्ति में उत्तर

उत्तर

2, 3, 3 

shaalaa.com
  क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
अध्याय 1.08: Conditional Statements in Java - EXERCISES [पृष्ठ ९९]

APPEARS IN

अविचल Computer Applications [English] Class 10 ICSE
अध्याय 1.08 Conditional Statements in Java
EXERCISES | Q III. 2. (a) | पृष्ठ ९९
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×