code

can you please check the calculator created by me, it`s not working?
#include<iostream>
using namespace std;
void main()
{
int A, B;
cout << "ededleri daxil edin:\n";
cin >> A >> B;
cout << "operatoru sechin"<<endl<<"+"<<endl<<"-"<<endl<<"*"<<"/"<<endl;

char s;
switch (s)

{
case '+':
cout << '+' << A + B << endl;
break;

case '-':
cout << '-' << A - B << endl;

break;

case '*':
cout << '*' << A * B << endl;

break;

case '/':
cout << '/' << A / B << endl;
break;

default:
cout << "error";
break;
}





}
You don't read the operator into s.
you never cin >> s -_-
Topic archived. No new replies allowed.