25 Ekim 2014 Cumartesi

C++ if - else - else if

C++ if - else - else if yapısı

#include <iostream>

using namespace std;

int main()
{
    int ort;
    cout<<"ortalamanizi giriniz:";
    cin>>ort;

    if(ort>90){
        cout<<"AA ile gectiniz.\n";

    }
    else if(ort>70){
        cout<<"BB ile gectiniz.\n";

    }
    else if(ort>50){
        cout<<"CC ile gectiniz.\n";
    }
    else{
        cout<<"Maalesef kaldiniz.\n";
    }


    return 0;
}

Hiç yorum yok:

Yorum Gönder