C++ ile Dört İşlem Yapan Bir Hesap Makinesi Yapmak

20
EXE RANK

OttoMaNs* ;яeiz

Fexe Kullanıcısı
Puanları 0
Çözümler 0
Katılım
20 Şub 2011
Mesajlar
32,869
Tepkime puanı
0
Puanları
0
Yaş
36
Web sitesi
www.netbilgini.com
OttoMaNs* ;яeiz
C++ ile toplama çıkarma çarpma ve bölme yapabilen bir hesap makinesi yapalım...

Evet kodlarımızı yazalım


Kod:
[LIST=1]
[*]#include <cstdlib>
[*]#include <iostream>

[*]using namespace std;

[*]int main(int argc,char *argv[])
[*]{
[*]    cout<<"*************************************"<<endl;
[*]    cout<<"*         HESAP MAKINESI            *"<<endl;
[*]    cout<<"*        TOPLAMA ICIN [+]           *"<<endl;
[*]    cout<<"*        CIKARMA ICIN [-]           *"<<endl;
[*]    cout<<"*        BOLME   ICIN [/]           *"<<endl;
[*]    cout<<"*        CARPMA ICIN            *"<<endl;    cout<<"*   Islemlerini Kullaniniz          *"<<endl;
[*]    cout<<"*        Sanalkurs.net              *"<<endl;
[*]    cout<<"*************************************"<<endl;
[*]    system("color F0");
[*]    float sayi1,sayi2,sonuc;
[*]    char islem;
[*]    cout<<"1.sayiyi giriniz :";
[*]    cin>>sayi1;
[*]    
[*]    cout<<"islemi giriniz :";
[*]    cin>>islem;
[*]    
[*]    cout<<"1.sayiyi giriniz :";
[*]    cin>>sayi2;
[*]    
[*]    switch(islem)
[*]    {
[*]       case '+':
[*]            sonuc = (sayi1+sayi2);
[*]            cout<<"Toplama Sonucu :"<<sonuc<<endl; break;
[*]            
[*]        case '-':
[*]            sonuc = (sayi1-sayi2);
[*]            cout<<"Cıkarma Sonucu :"<<sonuc<<endl; break;
[*]         
[*]        case '*':
[*]            sonuc = (sayi1*sayi2);
[*]            cout<<"Carpma Sonucu :"<<sonuc<<endl; break;   
[*]         
[*]          case '/':
[*]            sonuc = (sayi1/sayi2);
[*]            cout<<"Bolme Sonucu :"<<sonuc<<endl; break;
[*]                    
[*]                 }
[*]    
[*]    system("PAUSE");
[*]    return EXIT_SUCCESS;
[*]}
[/LIST]

Kodlarımız hazır eğer arka plan rengini değiştirmek siterseniz system("color F0"); satırındaki f0 değiştirebilirsiniz 4a-5b vs Kolay Gelsin...
 
Geri
Üst