View Single Post
Old Jan 1st, 2007, 10:08 PM   #1
Mixmaster
Newbie
 
Mixmaster's Avatar
 
Join Date: Sep 2006
Posts: 8
Rep Power: 0 Mixmaster is on a distinguished road
Whats wrong with newb code?

import java.io.* ;
public class life42  {
	private static BufferedReader stdin = new BufferedReader (
	new InputStreamReader ( System.in) ) ;
	
public static void main (String[] args) {
		
	System.out.println( "Enter a number") ;
	 String input = stdin.readLine();
	
	int a = Integer.parseInt ( input) ;
	
	if ((a !<= 0 || a !>= 0)) {
	System.out.println("Maybe if you enter a number..") ;}
		
		while ( a <= 0 || a >= 0) {
			
			System.out.println ("Input a number") ;
			input = stdin.readLine();
			a = Integer.parseInt(input) ;
			System.out.println(a) ; 
			}


			if (a == 42) {
System.exit;
	}
}

}

Im doing aome programming exercises. This one is supposed to accept input and output. It prints the number and closes when 42 is entered. Looks good to me, but it wont let me compile gives some ridiculous error messages. Any help?
Mixmaster is offline   Reply With Quote