1.

Rewrite the following code using switch statement :if (code = = ‘A’)allowance = 3500 ;elseif (code = = ‘B‘)allowance = 3200 :elseallowance = 2000 :

Answer»

Given code using switch statement :

switch (code) 

{

case A ;

allowance = 3500 ;

break ;

case B ;

allowance = 3200 ;

break ;

default ;

allowance = 2000 ;

break ;

}



Discussion

No Comment Found

Related InterviewSolutions