Created
March 18, 2013 23:38
-
-
Save mertyildiran/5192040 to your computer and use it in GitHub Desktop.
Yukarıda, komut satırından argüman olarak girilen (ikinci sayı daha büyük olacak biçimde) iki sayma sayısı ararındaki tüm sayıların toplamını veren (bu iki sayı da dahil) bir C programı verilmiştir. goto komutundan yararlanarak, ve for, while döngülerini kullanmadan, yukardaki programla aynı işlemi yapacak ve aynı çıktıyı üretecek bir C programı…
This file contains 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
#include <stdio.h> | |
#include <stdlib.h> | |
int main(void) | |
{ | |
int alt_sinir, ust_sinir, toplam, i; | |
scanf( "%d", &alt_sinir); | |
scanf( "%d", &ust_sinir); | |
printf("%d ile %d arasindaki sayilarin toplami : ", alt_sinir, ust_sinir); | |
toplam = 0; | |
etiket1: | |
toplam = toplam + alt_sinir; | |
alt_sinir++; | |
if(alt_sinir!=ust_sinir + 1) goto etiket1; | |
printf("%d", toplam); | |
system("pause"); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment