How to write a program to input three numbers(positive or negative). If they are unequal then display the greatest number otherwise, display they are equal. The program also displays whether the numbers entered by teh used are all positive, all negative or mixed numbers.
Answers
Answered by
1
Answer:
numbers and prints "All numbers are equal" if all three numbers are equal, "All numbers are different" if all three numbers are different and "Neither all are equal or different" otherwise.
Test Data
Input first number: 2564
Input second number: 3526
Input third number: 2456
Pictorial Presentation:
Answered by
4
Answer:
import java.util.*;
public class number
{
public static void main (string args [])
{
int a, b, c;
Scanner s=new Scanner (System.in);
System.out.println ("enter the three numbers");
a = s.nextInt ();
b = s.nextInt ();
c = s.nextInt ();
if (a > b && c);
System.out.println ("a is the greatest number");
Else if (b > a && c);
System.out.println ("b is the greatest number");
else
System.out.println ("c is the greatest number");
}
}
Explanation:
Similar questions
Hindi,
5 months ago
Social Sciences,
5 months ago
Geography,
10 months ago
Chemistry,
1 year ago
Math,
1 year ago