Skip to content

Commit 1ee2613

Browse files
author
StephLew1
committed
Completed Comparing Values
1 parent 3c0d4a3 commit 1ee2613

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

ch05/Condition.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
public class Condition
2+
{
3+
4+
public static void main(String[] args)
5+
6+
{
7+
int num1 = 1357;
8+
int num2 = 2468;
9+
String result ;
10+
result = ( num1 % 2 != 0 ) ? "Odd": "Even";
11+
System.out.println(num2 + " is " + result);
12+
result = ( num2 % 2 != 0 ) ? "Odd" : "Even" ;
13+
System.out.println( num2 + " is " + result ) ;
14+
}
15+
16+
17+
}

0 commit comments

Comments
 (0)