Created
February 7, 2018 02:09
-
-
Save viveknarang/b218111822523fc73fa2adda86248fad to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
public class NegativeOrPositive { | |
public static void main (String [] args) { | |
String condStr; | |
int userVal; | |
userVal = -9; | |
condStr = (userVal >= 0)?"non-negative":"negative"; | |
System.out.println(userVal + " is " + condStr); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment