Multiple Choice Question

Quiz Guidelines

 

QID: 
339
Question: 

What will the following program print?

class Test{       
public static void main(String args[]){      
int k = 9, s = 5;      
switch(k){         
default :         
if( k == 10) { s = s*2; }         
else{            
s = s+4;            
break;         }         
case 7 : s = s+3;      }      
System.out.println(s);   } }

Select 1 option

A. 5 
B. 9 
C. 12 
D. It will not compile. 

Q&A Set: