Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: what is wrong with this code???plz help me :(

  1. #1
    Junior Member
    Join Date
    Sep 2011
    Posts
    2
    My Mood
    Confused
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default 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 ");



    }
    }


  2. #2
    Super Moderator Sean4u's Avatar
    Join Date
    Jul 2011
    Location
    Tavistock, UK
    Posts
    637
    Thanks
    5
    Thanked 103 Times in 93 Posts

    Default 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.

  3. The Following 2 Users Say Thank You to Sean4u For This Useful Post:

    happyxcrab (September 17th, 2011), KevinWorkman (September 17th, 2011)

  4. #3
    Member
    Join Date
    Mar 2011
    Posts
    66
    My Mood
    Relaxed
    Thanks
    12
    Thanked 4 Times in 4 Posts

    Default 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.

Similar Threads

  1. want wrong with my code
    By drum in forum Member Introductions
    Replies: 1
    Last Post: May 20th, 2011, 09:06 AM
  2. What is Wrong with my code
    By xew123 in forum What's Wrong With My Code?
    Replies: 1
    Last Post: March 8th, 2011, 04:59 AM
  3. what is wrong in this code
    By rk.kavuri in forum What's Wrong With My Code?
    Replies: 2
    Last Post: March 6th, 2011, 03:13 PM
  4. what's wrong in this code
    By Aravind in forum What's Wrong With My Code?
    Replies: 2
    Last Post: January 4th, 2011, 03:38 AM
  5. What's wrong with my code ?
    By mithani in forum What's Wrong With My Code?
    Replies: 2
    Last Post: November 5th, 2010, 08:57 AM