Created
November 28, 2015 12:26
-
-
Save cagataycali/49afe4498d3ad7e3e942 to your computer and use it in GitHub Desktop.
Birden yüze kadar olan tek sayıların toplamını hesaplayan c programı ( While ile )
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
#include <stdio.h> | |
/* | |
1'den 100'e kadar olan tek sayıları toplayıp ekrana yazacağız. | |
*/ | |
int main(void) | |
{ | |
int toplam = 0,i=1; | |
/* İ sayacımız 100'e gelene kadar dönecektir */ | |
while(i < 100) | |
{ | |
printf("Sayınız: %d , Toplamı: %d \n",i,toplam); | |
toplam += i; | |
i = i + 2; | |
} | |
printf("Toplam: %d \n",toplam ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment