C++ Hesap Makinesi Yapma

#include
#include
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; }>

You may also like...

Bir cevap yazın

E-posta hesabınız yayımlanmayacak. Gerekli alanlar * ile işaretlenmişlerdir

This site uses Akismet to reduce spam. Learn how your comment data is processed.