Compilation error in Life, the Universe, and Everything????

import java.util.Scanner;

public class Print {

public static void main(String[] args) {
   
    for(int i=2;i>=0;i++) {
    
   Scanner scanner = new Scanner(System.in);
   int n = scanner.nextInt();
   
   if(n == 42){
       break;
   }
   
   if(n>=100) {
       break;
   }
   System.out.println(n);
}

}
}

1)You can’t declare your class public( Either change the access specifier or rename the class to main) on codechef. . http://www.codechef.com/help#hc_solinjav
2)Their is also a error in your code.
With some li’l changes it works fine. :slight_smile:
Happy coding.
link : http://www.codechef.com/viewsolution/4304050

1 Like

Thank you ver much. Finally worked :slight_smile:

//