what is wrong with this code???plz help me :(
package kanika;
import java.io.*;
public class Kanika {
/**
* @param args the command line arguments
*/
public static void main(String[] args) throws IOException {
// TODO code application logic here
System.out.print("enter the no");
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int input = Integer.parseInt(br.readLine());
if(input % 2 == 0 )
{
System.out.println("the number is even");
}
else
System.out.println("the number is odd ");
}
}
Re: what is wrong with this code???plz help me :(
Forums don't work like that. You post code (in code tags so it doesn't look a mess), and *tell us* what's wrong with it by copy and pasting compiler errors or Exceptions and stack traces, or unexpected output. If you do that, someone will look at your post and help you work out *why* it's wrong.
Re: what is wrong with this code???plz help me :(
The code looks fine to me. Although I don't know what is in the Kanika package (I'm still learning about them at the moment), there seems to be nothing wrong with your code. It compiles and runs just as it should.