Untitled
unknown
plain_text
10 months ago
346 B
13
Indexable
const dizi1: number[] = [12, 5, 40, 8, 25];
function enBuyukFor(dizi: number[]): number {
let enBuyuk = dizi[0];
for (let i = 1; i < dizi.length; i++) {
if (dizi[i] > enBuyuk) {
enBuyuk = dizi[i];
}
}
return enBuyuk;
}
console.log(`\nEn Büyük Sayı (For): ${enBuyukFor(dizi1)}`);Editor is loading...
Leave a Comment