Created
February 12, 2023 11:00
-
-
Save MocaaDevv/7ae3982bc73fe810bf5edb7fee47dd97 to your computer and use it in GitHub Desktop.
Bu program, kullanıcı tarafından girilen üç sayıyı sıralamak için tasarlanmıştır. Kullanıcı öncelikle "A", "B" ve "C" değerlerini girer ve sonra program, bu değerlerin hangilerinin en büyük olduğunu ve diğerlerinin hangi sırada olduğunu tespit eder. Sonuç olarak, en büyük sayıdan en küçük sayıya doğru bir sıralama yapılır ve ekrana yazdırılır.
This file contains hidden or 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 SayilariSirala { | |
| public static void main(String[] args) { | |
| Scanner input = new Scanner(System.in); | |
| double a,b,c; | |
| System.out.print("A : "); | |
| a = input.nextDouble(); | |
| System.out.print("B : "); | |
| b = input.nextDouble(); | |
| System.out.print("C : "); | |
| c = input.nextDouble(); | |
| if(a > b && a > c){ | |
| if(b > c){ | |
| System.out.print("A > B > C"); | |
| }else{ | |
| System.out.print("A > C > B"); | |
| } | |
| }else if(b > c && b > a) | |
| if(c > a){ | |
| System.out.print("B > C > A"); | |
| }else{ | |
| System.out.print("B > A > C"); | |
| }else{ | |
| if(a > b){ | |
| System.out.print("C > A > B"); | |
| }else{ | |
| System.out.print("C > B > A"); | |
| } | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment