İki Aralık Arasındaki Sayıları Toplama

mustaphos

MB Üyesi
Kayıt
14 Eylül 2015
Mesajlar
35
Tepkiler
8
Yaş
28
Meslek
Öğrenci
Üniv
Anadolu University
Merhaba.
Bu program iki sayı arasındaki sayıların toplamının sonucunu gösterir.
İyi çalışmalar.

#include <stdio.h>
#include <stdlib.h>
#include <conio.h>
void main ()

{

int lowest,highest,counter;
counter = 0;

printf("Please enter the lowest number : ");
scanf("%d",&lowest);
printf("Please enter the highest number : ");
scanf("%d",&highest);

while (lowest <= highest)
{

counter = counter + lowest ;
lowest++;

}

printf("%d",counter);

getch();
}
 
Yukarı Alt