public static void getLargest() {
Scanner scanner = new Scanner(System.in);
int a, b, c;
System.out.println("Sonlar orasidan eng kattasini topish!");
System.out.print("Birinchi sonni kiriting: ");
a = scanner.nextInt();
System.out.print("Ikkinchi sonni kiriting: ");
b = scanner.nextInt();
System.out.print("Uchinchi sonni kiriting: ");
c = scanner.nextInt();
if (a > b) {
if (a > c) {
System.out.println(a + " eng katta son! Birinchi son!");
} else {
System.out.println(c + " eng katta son! Uchinchi son!");
}
} else {
if (b > c) {
System.out.println(b + " eng katta son! Ikkinchi son!");
} else {
System.out.println(c + " eng katta son! Uchinchi son!");
}
}
}
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter