Created
February 28, 2018 06:46
-
-
Save marufmax/5e716394ea52761312ad8c289bf3b38c to your computer and use it in GitHub Desktop.
Java Posetive and Negetive number checking using If else elseif
This file contains hidden or 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
public class JavaBasic { | |
/** | |
* @param args the command line arguments | |
*/ | |
public static void main(String[] args) { | |
Scanner input = new Scanner(System.in); | |
int num; | |
System.out.println("Enter Any Number: "); | |
num = input.nextInt(); | |
if (num>0) { | |
System.out.println("Postive"); | |
} | |
else if(num==0) | |
{ | |
System.out.println("Equal"); | |
} | |
else | |
{ | |
System.out.println("Negetive"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment