package com.devmanuals2; import java.io.*; public class DoWhileExample { public static void main(String[] args) throws IOException { int ch = 0; do { System.out.println("Enter any no from 1 to 6"); BufferedReader buffread = new BufferedReader(new InputStreamReader( System.in)); String str = buffread.readLine(); ch = Integer.parseInt(str); if (ch < 7) { switch (ch) { case 1: System.out.println("You are a smart person"); break; case 2: System.out.println("You are a clever person"); break; case 3: System.out.println("You are a follower person"); break; case 4: System.out.println("You are a unsatisfied person"); break; case 5: System.out.println("You are a lazy person"); break; case 6: System.out.println("You are a disappointed person"); break; } } else { System.out.println("Exit from the program........"); System.exit(0); } } while (ch < 7); } }