Created
January 21, 2022 00:27
-
-
Save smyy96/ba89edbf76b602b02bb0361877e4c640 to your computer and use it in GitHub Desktop.
Patika Java 101 - Sayıları Büyükten Küçüğe Sıralama
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
public class büyüksayi { | |
public static void main(String[] args) { | |
Scanner input = new Scanner(System.in); | |
int sayi1, sayi2, sayi3, enbuyuk; | |
System.out.print("1.Sayı: "); | |
sayi1 = input.nextInt(); | |
System.out.print("2.Sayı: "); | |
sayi2 = input.nextInt(); | |
System.out.print("3.Sayı: "); | |
sayi3 = input.nextInt(); | |
if (sayi1 > sayi2 && sayi1 > sayi3) { | |
if (sayi2 > sayi3) | |
System.out.print(sayi1 + ">" + sayi2 + ">" + sayi3); | |
else | |
System.out.print(sayi1 + ">" + sayi3 + ">" + sayi2); | |
} | |
if (sayi2 > sayi1 && sayi2 > sayi3) { | |
if (sayi1 > sayi3) | |
System.out.print(sayi2 + ">" + sayi1 + ">" + sayi3); | |
else | |
System.out.print(sayi2 + ">" + sayi3 + ">" + sayi1); | |
} | |
if (sayi3 > sayi2 && sayi3 > sayi1) { | |
if (sayi1 > sayi2) | |
System.out.print(sayi3 + ">" + sayi1 + ">" + sayi2); | |
else | |
System.out.print(sayi3 + ">" + sayi1 + ">" + sayi2); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment