write a program to find greatest of 3 numbers?
Answers
Answered by
1
Answer:
import java.util.Scanner;
public class brainly {
public static void main (string []args) {
Scanner sc = new Scanner (System.in);
int a = sc.nextInt();
int b = sc.nextInt();
int c = sc.nextInt();
if (a > b && a> c) {
System.out.println(a + "is the greatest");
}
else if (b>a && b>c) {
System.out.println(b + "is the greatest");
}
else if (c>b && c > a) {
System.out.println(c + "is the greatest");
}
}
}
Similar questions
Social Sciences,
3 months ago
Computer Science,
3 months ago
Math,
5 months ago
Physics,
5 months ago