Skip to content

Instantly share code, notes, and snippets.

@marufmax
Created February 28, 2018 06:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marufmax/5e716394ea52761312ad8c289bf3b38c to your computer and use it in GitHub Desktop.
Save marufmax/5e716394ea52761312ad8c289bf3b38c to your computer and use it in GitHub Desktop.
Java Posetive and Negetive number checking using If else elseif
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