KLAVYEDEN GİRİLEN 10 SAYININ
EN BÜYÜK VE EN
KÜÇÜK OLANINI BULAN PROGRAM.
HER PROGRAM İÇİN PAYLAŞIMLARI GÖRMEK İÇİN SİTEMİZİ TAKİP EDİN..
KAYNAK KOD
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
| using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ConsoleApplication16 { class Program { static void Main(string[] args) { int enBuyuk, enKucuk, sayi, sayi2, sayac = 1; Console.Write("Bir Sayi Giriniz: "); sayi = Convert.ToInt32(Console.ReadLine()); enBuyuk = sayi; enKucuk = sayi; tekrar: if (sayac < 10) { Console.Write("Bir Sayi Giriniz : "); sayi2 = Convert.ToInt32(Console.ReadLine()); if (sayi2 > enBuyuk) { enBuyuk = sayi2; } else if (sayi2<enKucuk) { enKucuk = sayi2; } sayac++; goto tekrar; } Console.WriteLine("En Büyük Sayi {0}", enBuyuk); Console.WriteLine("En Küçük Sayi {0}", enKucuk); Console.ReadKey(); } } } |
0 yorum:
Yorum Gönder