Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Java] Even or Odd
08-14-2009, 11:39 AM
Post: #1
[Java] Even or Odd
Taken idea from Back_Tracks even or odd in c#. Made it in Java.

Code:
/**
* @(#)Even_or_Odd.java
*
* Even_or_Odd application
*
* @author Ant
* @version 1.00 2009/8/11
*/

import java.util.Scanner;
import java.lang.String;

public class Even_or_Odd {
    
    public static void main(String[] args) {
        int number;
        Scanner in = new Scanner(System.in);
        
        System.out.println("Please enter number to check whether even or odd: ");
        number = in.nextInt();
        
        if(number % 2 == 0)
        {
            System.out.println(number+" is even");
            in.nextLine();
        }
        else
        {
            System.out.println(number+" is odd");
            in.nextLine();
        }
    }
}
Find all posts by this user
Quote this message in a reply
08-14-2009, 04:17 PM
Post: #2
RE: [Java] Even or Odd
Nice the last person who was from Hack forums tried this and he failed making it at java but you succeeded well done

"Character is determined more by the lack of certain experiences than by those one has had."
Friedrich Nietzsche
Visit this user's website Find all posts by this user
Quote this message in a reply
08-14-2009, 05:32 PM
Post: #3
RE: [Java] Even or Odd
Yeah, good code, i don't know much about java, but as i can see, it is almost the same as c#.
c# is like a mix of all c languages and it took good things from some other languages too !

"I dont know with what weapons World War 3 will be fought with, but i know World War 4 will be fought with stones and sticks" - Albert Einstein
Visit this user's website Find all posts by this user
Quote this message in a reply
08-14-2009, 10:15 PM
Post: #4
RE: [Java] Even or Odd
Ah yah, thanks for comments.
Java isn't all that bad to be honest, and isn't too hard to get into!
Not to mention, if i could ever become pro, the number of job opportunities out there working with java is mad good!
Find all posts by this user
Quote this message in a reply
08-14-2009, 10:25 PM
Post: #5
RE: [Java] Even or Odd
Yeah, i like C# and Oracle databases, from them you can earn a lot !

"I dont know with what weapons World War 3 will be fought with, but i know World War 4 will be fought with stones and sticks" - Albert Einstein
Visit this user's website Find all posts by this user
Quote this message in a reply
12-09-2009, 08:05 AM
Post: #6
RE: [Java] Even or Odd
oToom nice code. Wink

@Back_track
Quote:Nice the last person who was from Hack forums tried this and he failed making it at java but you succeeded well done
Huh you want to say, that a guy tried it and couldnt make this program work?

[Image: 45669_pythonlogo.png][Image: 45668_javalogo.png]
Find all posts by this user
Quote this message in a reply
12-09-2009, 08:08 AM
Post: #7
RE: [Java] Even or Odd
(12-09-2009 08:05 AM)Alphablend Wrote:  oToom nice code. Wink

@Back_track
Quote:Nice the last person who was from Hack forums tried this and he failed making it at java but you succeeded well done
Huh you want to say, that a guy tried it and couldnt make this program work?

No by that i mean he attempted to make this same program in Java but failed in his attempt

"Character is determined more by the lack of certain experiences than by those one has had."
Friedrich Nietzsche
Visit this user's website Find all posts by this user
Quote this message in a reply
12-09-2009, 08:25 AM
Post: #8
RE: [Java] Even or Odd
(12-09-2009 08:08 AM)Back_track Wrote:  
(12-09-2009 08:05 AM)Alphablend Wrote:  oToom nice code. Wink

@Back_track
Quote:Nice the last person who was from Hack forums tried this and he failed making it at java but you succeeded well done
Huh you want to say, that a guy tried it and couldnt make this program work?

No by that i mean he attempted to make this same program in Java but failed in his attempt

strange... its not a difficult one.

[Image: 45669_pythonlogo.png][Image: 45668_javalogo.png]
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


 Quick Theme: