#1
|
||||
|
||||
C++ ta hesap makinesi
#include <iostream.h>
#include <stdlib.h> int main() //hesap makinesi { //meric-mericliler int n; long int a,b; cout<<"Bu hesap makinesi dir!! >>>meric_MERICLILER<<<"<<endl; 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 heralde<<endl;break;} cout<<"bu programi >>>PROGRAMCI MERIC<<< yapmistir..."<<endl<<endl; system("PAUSE"); return 99; } |