-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathcalculatori.cpp
executable file
·42 lines (42 loc) · 1.12 KB
/
calculatori.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#include <iostream>
using namespace std;
int main()
{
int x,y,z;
char operatori;
cout<<"Ketili iyos tqveni mobrZaneba programa kalkulatorshi"<<endl;
cout<<"Kalkulatoris mushaobis gacherebis piroba, operatori='.'"<<endl;
do{
cout<<"Shemoitanet x cvladis mnishvneloba"<<endl;
cin>>x;
cout<<"Shemoitanet y cvladis mnishvneloba"<<endl;
cin>>y;
cout<<"Shemoitanet cvladebs shoris operatori"<<endl;
cout<<"Dasashvebi operatorebis sia: + - * / %"<<endl;
cin>>operatori;
cout<<"kalkulatori angarishobs shemdegi operaciis shedegs "<<endl<<"x "<<operatori<<" y = ";
switch(operatori)
{
case '+':
z=x+y;
break;
case '-':
z=x-y;
break;
case '*':
z=x*y;
break;
case '/':
z=x/y;
break;
case '%':
z=x%y;
break;
default:
cout<<"operacia ar moiZebna"<<endl;
break;
}
cout<<z<<endl;
} while(operatori!='.');
return 0;
}