write a program to input an integer and check whether it is a positive negative or a zero, using if-else-if ladder _____pls don't spam u will waste my 10 points that I have gained by answering right questions show some mercy on me
Answers
Answered by
2
Answer:
import java.util.*;
class PositiveInt
{
public void main()
{
Scanner sc = new Scanner (System.in);
System.out.println("Enter an integer: ");
int n = sc.nextInt();
if(n > 0)
{
System.out.println('It ia an positive integer");
}
if(n == 0)
{
System.out.println("It is a Zero");
}
}
}
I hope you find it useful... If you have any query do comment, I will try to solve it...
Similar questions