Hi Pritam,
There are 4 Compile Errors in the code. Fixed all those, and the code is like the following in a Readable format. I have added a println() inside the do-while loop.
And the output is self explanatory . Consider the fall through in switch() {}
Hope this is clear
SCJP6, SCWCD5, OCP-JBCD5, OCE-JWSD6 OCE-JPAD6 , OCM-JEA5 1,OCM-JEA5 2,3,OCJP8 - Brainbench certifications: J2EE, Java2, Java2-NonGUI, JSP, SQL2000 Admin, SQL2000 Programming , Brainbench certified Java Programmer, Computer Programmer, Web Developer, Database Administrator