Created
February 9, 2016 20:24
-
-
Save ardamavi/752622e20c63a867fb5d to your computer and use it in GitHub Desktop.
C# ile Forumdan sorulan küçük algoritma sorusunu cevaplıyorum.
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
| using System; | |
| namespace ArdaMavi | |
| { | |
| class MainClass | |
| { | |
| public static void Main (string[] args) | |
| { | |
| // Arda Mavi | |
| for(int i = 0; i<=4;i++){ | |
| // i bir tamsayı ve 0 değerine eşit. Döngü, i 4'e eşit ya da 4'den küçük olana kadar devam edecek. i sayısı her tekrarda 1 arttırılacak. | |
| int c = 31; | |
| // c sayısı 31'e eşit | |
| for(int b = 0; b<=i ;b++){ | |
| // b bir tamsayı ve 0 değerine eşit. Döngü, b, i'ye eşit ya da i'den küçük olana kadar devam edecek. b sayısı her tekrarda 1 arttırılacak. | |
| Console.Write(c + " "); | |
| // c ekrana yazdırılacak ve bir boşluk bırakılacak. | |
| c = c-6; | |
| // c'den 6 çıkarılıp c'ye atanacak. | |
| } | |
| Console.Write("\n"); | |
| // Yeni satıra geçmek için. | |
| } | |
| /* | |
| Konsol çıktısı : | |
| 31 | |
| 31 25 | |
| 31 25 19 | |
| 31 25 19 13 | |
| 31 25 19 13 7 | |
| */ | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment