fork download
  1. class Naveen
  2. {
  3. public static void main(String[] args)
  4. {
  5. String[] no={"Alcohol","Smoking","Gambling","Drugs"};
  6. String[] yes={"Music","Preparation","Trips","Friends","Job"};
  7. int a=0;
  8.  
  9. for(int i=0;i<no.length;i++)
  10. {
  11. System.out.println("NO "+no[i]);
  12. }
  13. while((yes[a].compareTo("Job"))!=0)
  14. {
  15. System.out.println(yes[a]);
  16. a++;
  17. }
  18.  
  19. }
  20. }
Success #stdin #stdout 0.13s 57412KB
stdin
10
aba
geeksforgeeks
geeksforgeeks
geeksforgeeks
geeksforgeeks
geeksforgeeks
geeksforgeeks
geeksforgeeks
geeksforgeeks
geeksforgeeks
stdout
NO Alcohol
NO Smoking
NO Gambling
NO Drugs
Music
Preparation
Trips
Friends