Üye Kayıt Üye Giriş

hesap makinesi


hesap makinesi


#include <iostream.h>
#include <stdlib.h>
     int main()                                        
      {                                             
        int n;
        long int a,b                
cout<<"Asagidaki islemilerden birini seciniz:"<<endl<<endl;
                cout<<"Toplama islemi icin=1"<<endl;
                cout<<"Cikarma islemi icin=2"<<endl;
                cout<<"Carpma islemi icin=3"<<endl;
                cout<<"Bolme islemi icin=4"<<endl<<endl;
                cout<<"Kare koku icin=5"<<endl;
                cout<<"Kare alma islemi icin=6"<<endl;
                      cin>>n;
                   if(n>=5)
                   {
                      cout<<"Sadece tek sayi giriniz"<<endl;
                      cin>>a;
                   }
                   else
                   {
                      cout<<"Ilk sayi'yi giriniz"<<endl;
                      cin>>a;
                           cout<<"Ikinci sayi'yi giriniz"<<endl;
                      cin>>b;
                  }

                                             switch(n){
                                             case 1:{cout<<"Sonuc="<<a+b<<endl;break;}
                                             case 2:{cout<<"Sonuc="<<a-b<<endl;break;}
                                             case 3:{cout<<"Sonuc="<<a*b<<endl;break;}
                                             case 4:{cout<<"Sonuc="<<a/b<<endl;break;}
                                             case 5:{cout<<"Sonuc="<<sqrt(a)<<endl;break;}
                                             case 6:{cout<<"Sonuc="<<a*a<<endl;break;}

                                                   defult:cout<<"yanlis tusa bastin "<<endl;break;}
  cout<<"---- "<<endl<<endl;
                                                                system("PAUSE");
        return 99;
}

 

Bilgisayar Dershanesi Ders Sahibi;
Bilgisayar Dershanesi

Yorumlar

Yorum Yapabilmek İçin Üye Girişi Yapmanız Gerekmektedir.

ETİKETLER