Write A Java Program To Store A Number Find If It Is Positive Or A Negative Number If Positive Print I Am The First?

1

1 Answers

Ambika ambi Profile
Ambika ambi answered
Import java.io.*;
class Check
{
public static void main(String args[])
{
DataInputStream d = new DataInputStream(System.in);
int n=0;
System.out.print("Enter any integer number");
n=Integer.parseInt(d.readLine());
if(n>0)
System.out.println("I am the first"); //number is positive

else
system.out.println("The number is negative");
}
}

Answer Question

Anonymous