Write a java.program to print the positive number
Answers
Answered by
0
Answer:
import java.util.Scanner;
public class Postive_Negative
{
public static void main(String[] args)
{
int n;
Scanner s = new Scanner(System.in);
System.out.print("Enter the number you want to check:");
n = s.nextInt();
if(n > 0)
{
System.out.println("The given number "+n+" is Positive");
}
else if(n < 0)
{
System.out.println("The given number "+n+" is Negative");
}
else
{
System.out.println("The given number "+n+" is neither Positive nor Negative ");
}
}
}
Explanation:
Similar questions
English,
5 months ago
World Languages,
5 months ago
English,
11 months ago
Geography,
11 months ago
Math,
1 year ago