Enter 3 numbers. check whether they are all positive or negative or mixed number.
Java programming
Answers
Answered by
0
Answer:
//to check whether the 3 numbers are positive,negative or mixed
import.java.util.*;
public class nos
{
public static void main()
{
Scanner on=new Scanner(System.in);
int a,b,c;
System out.println("enter any 3 numbers");
a=ob.nextInt();
b=on.nextInt();
c=ob.nextInt();
if (a>0)
System.out.println("no is positive");
else if (b<0)
System.out.println("no is negative");
else
System.out.println("no is mixed");
}
}
Explanation:
i used scanner class here
Similar questions
Computer Science,
18 hours ago
Math,
18 hours ago
Environmental Sciences,
1 day ago
Social Sciences,
8 months ago
English,
8 months ago
Business Studies,
8 months ago