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(;
   int n = scanner.nextInt();
   if(n == 42){
   if(n>=100) {


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

1 Like

Thank you ver much. Finally worked :slight_smile: