Computer Science, asked by sadaffarheen20, 16 hours ago

write a program to find greatest of 3 numbers?

Answers

Answered by purveshKolhe
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