I
ianenis.tiryaki
well i wrote this code but it doesn't work and shows me bunch of
syntax if you can help me out finding them i would appreciate it!
the program should do simple calculations and no parenthesis are
allowed.so it is basically really simple but i am new at programming
and not sure about my code. Thank you!
here is my code:
#include <iostream>
#include <string>
#include <iostream.h>
using namespace std;
void main()
{
int b, c ; //declearing the variables
int reply;
int output;
cout << "Please enter 2 numbers" << endl;
cin >> b >> c;
cout <<"The Value of b: " << b << endl;
cout <<"The Value of c: " << c << endl;
cout << "please type '+' for abstraction, '-' for substraction,
'/' for division, and '*' for multipication"<< endl;
cin >> reply >>;
if (reply= + ) {
output = b + c;
}
else if (reply = - ) {
output = b - c;
}
else if (reply = / ) {
output = b / c;
}
else if (reply = * ) {
output = b * c;
}
cout << "output: " << output << endl;
// This section stops the program 'flashing' off the screen.
cout << "Press q (or any other key) followed by 'Enter' to quit:
";
cin >> reply;
return 0;
}
syntax if you can help me out finding them i would appreciate it!
the program should do simple calculations and no parenthesis are
allowed.so it is basically really simple but i am new at programming
and not sure about my code. Thank you!
here is my code:
#include <iostream>
#include <string>
#include <iostream.h>
using namespace std;
void main()
{
int b, c ; //declearing the variables
int reply;
int output;
cout << "Please enter 2 numbers" << endl;
cin >> b >> c;
cout <<"The Value of b: " << b << endl;
cout <<"The Value of c: " << c << endl;
cout << "please type '+' for abstraction, '-' for substraction,
'/' for division, and '*' for multipication"<< endl;
cin >> reply >>;
if (reply= + ) {
output = b + c;
}
else if (reply = - ) {
output = b - c;
}
else if (reply = / ) {
output = b / c;
}
else if (reply = * ) {
output = b * c;
}
cout << "output: " << output << endl;
// This section stops the program 'flashing' off the screen.
cout << "Press q (or any other key) followed by 'Enter' to quit:
";
cin >> reply;
return 0;
}