26 Temmuz 2011 Salı

C'de Sınav puanına göre notunu hesaplama

#include < stdio.h >
#include < stdlib.h >

int main()
{

int puan;

printf("Sinav notunu gir: ");
scanf("%d",&puan);
while (puan<0 || puan > 100) // bu döngü ile 0'dan küçük veya 100'den büyük sayı gilirse sorguyu tekrarlatıyoruz.
{
printf("Sinav notunu gir: ");
scanf("%d",&puan);
}
// sınav puanı doğru girildiği takdirde while döngüsünü geçip if else döngüleriyle puan aralığına göre notumuzu alıyoruz.
if( puan <=59 )
printf("Notunuz F \n");
else if (puan >= 60 && puan <=69)
printf("Notunuz D \n");
else if (puan >= 70 && puan <=74)
printf("Notunuz CC \n");
else if (puan >= 75 && puan <=79)
printf("Notunuz CB \n");
else if (puan >= 80 && puan <=84)
printf("Notunuz BB \n");
else if (puan >= 85 && puan <=89)
printf("Notunuz BA \n");
else if (puan >= 90 && puan <=100)
printf("Notunuz AA \n");
return 0;
}

1 yorum:

  1. WynnBET Casino: 2021 All You Need to Know - JTM Hub
    Jumbo is a five-reel, three-row video poker-style 목포 출장마사지 slot game in 충청북도 출장안마 which the object is to win real money. 밀양 출장안마 You bet on 김제 출장마사지 a number of bets – whether that win or 춘천 출장안마

    YanıtlaSil