Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 978fe47

Browse files
🍵
1 parent a95884d commit 978fe47

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

‎challenge10.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import java.util.Scanner;
2+
3+
// Create a program that determines if a number is positive, negative, or zero.🚀
4+
public class challenge10 {
5+
public static void main(String[] args) {
6+
Scanner sc = new Scanner(System.in);
7+
System.out.print("Please enter number: ");
8+
int input = sc.nextInt();
9+
if(input < 0){
10+
System.out.println("Number is negative: "+input);
11+
} else if(input == 0){
12+
System.out.println("Number is Zero: "+input);
13+
} else{
14+
System.out.println("Number is positive: "+input);
15+
}
16+
}
17+
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /