how to make a program (java language) determining positive and negative numbers?

you will enter a number. ( for example 5 different numbers) others are postive and others are negative. how the systems determined that numbers. the program must be in a class form of java program. pls answer me

Answers:
import java.io.IOException;

public class PosNeg {

public static void main(String[] args) {

int [] wNumbers;
wNumbers = new int[5];
char c = ' ';

for (int i=0;i<5;i++) {
System.out.print("Enter the #"+i+": ");
try {
wNumbers[i]=System.in.read()-4...
if (wNumbers[i]<0)
wNumbers[i]=(System.in.read()-...
while (System.in.read()!='\n'){
}
} catch (IOException e) {
e.printStackTrace();
}
System.out.print("The number you entered is ");
if (Math.abs(wNumbers[i])!=wNumbe...
System.out.println("negative."...
else
System.out.println("positive."...
}
}
}

Other answers:
try comparing the absolute value of the number. If it is equal, then it is positive otherwise, it is negative.

Hint: Try the abs method of Math.

  • When will I be able to leave my wheel chair ?
  • How to find the complexity of an algorithm in a simple way?
  • how can we run email application in asp.net and what name should be given to smtpserver?
  • Microsoft Visual Basic automatic button press.?
  • is anyone else having a problem answering questions?
  • when we place cursor on word it glow how t give this effect?
  • Where can I find an Afrikaans dictionary for Adobe InDesign?
  • how do i get around school smart filters to watch porn?
  • How do I download my panasonic video recordings on to my computer?
  • Is there an easy way to move your users, messages, ranks, smilies, etc. from phpbb to vBulletin? If so, how?