Hey,
I’m a novice programmer and recently decided to join CodeChef to expand my knowledge. I’m attempting the first easy question called, ‘Life, the Universe, and Everything’ and I’ve written some code and was wondering if you guys could help me resolve the problems within.
import java.io.*;
import java.util.*;
public class Main {
public static void main (String [] args) {
int i;
Scanner kbReader = new Scanner(System.in);
System.out.println("Please input an integer: ");
int fortytwo = kbReader.nextInt();
for (i = 0; i > 10; i++) {
if (fortytwo == 42) {
i = 10;
} else {
System.out.println(fortytwo);
System.out.println("Please input an integer: ");
fortytwo = kbReader.nextInt();
}
}
}
}
Thanks again,
Dillon