Skip to content

Instantly share code, notes, and snippets.

@irfanevrens
Last active June 29, 2022 18:19
Show Gist options
  • Save irfanevrens/d45b988a94582e1ed21b10fd3a494dc6 to your computer and use it in GitHub Desktop.
Save irfanevrens/d45b988a94582e1ed21b10fd3a494dc6 to your computer and use it in GitHub Desktop.
import java.util.Scanner;
public class Program {
public static void main(String[] args) {
final int SAYI_ADET = 10;
int[] sayilar = new int[SAYI_ADET];
Scanner scanner = new Scanner(System.in);
for (int i = 0; i < SAYI_ADET; i++) {
System.out.print((i + 1) + ". sayıyı giriniz: ");
sayilar[i] = scanner.nextInt();
}
scanner.close();
int enKucukSayi = sayilar[0];
for (int siradakiSayi : sayilar) {
if (siradakiSayi < enKucukSayi) {
enKucukSayi = siradakiSayi;
}
}
System.out.println("En küçük sayı: " + enKucukSayi);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment