public class doWhilePracticleEx {
public void test() {
}
public static void main(String args[]) {
String q1 = "Who is PM of India?";
String a1 = "Sonia Gandhi";
String a2 = "Rahul Gandhi";
String a3 = "Amit Shah";
String a4 = "Narendra Modi";
System.out.println(q1);
System.out.println(a1);
System.out.println(a2);
System.out.println(a3);
System.out.println(a4);
String user="";
int attemptCount=1; //no of attempts
do {
if(attemptCount==1) {
System.out.println("Enter Your answer");
}
Scanner sc = new Scanner(System.in);
//control + shift+ o
user = sc.nextLine();
attemptCount++;
} while(!user.equalsIgnoreCase(a4));
System.out.println("Your answer is correct!!!!!");
}
}