10.5 and 15.75, or 10 1/2 and 15 3/4
Hope Your Thanksgiving Goes Well, Here's A Turkey
-TheKoolKid1O1
Let's solve for x.
3
x
+
5
y
=
10
Step 1: Add -5y to both sides.
3
x
+
5
y
+
−
5
y
=
10
+
−
5
y
3
x
=
−
5
y
+
10
Step 2: Divide both sides by 3.
3
x
3
=
−
5
y
+
10
3
x
=
−
5
3
y
+
10
3
Answer:
x
=
−
5
3
y
+
10
3
It takes value from a user and then user the operation of (+,-,*/).
i used c++ programming language to solve this program:
#include<iostream>
using namespace std;
int main() {
int var1, var2;
char operation;
cout << "Enter the first number : ";
cin >> var1;
cout << endl;
cout <<"Enter the operation to be perfomed : ";
cin >> operation;
cout << endl;
cout << "Enter the second nuber : ";
cin >> var2;
cout << endl;
bool right_input = false;
if (operation == '+') {
cout << var1 << " " << operation << " " << var2 << " = " << (var1 + var2);
right_input = true;
}
if (operation == '-') {
cout << var1 << " " << operation << " " << var2 << " = " << (var1 - var2);
right_input = true;
}
if (operation == '*') {
cout << var1 << " " << operation << " " << var2 << " = " << (var1 * var2);
right_input = true;
}
if (operation == '/' && var2 != 0) {
cout << var1 << " " << operation << " " << var2 << " = " << (var1 - var2);
right_input = true;
}
if (operation == '/' && var2 == 0) {
cout << "Error. Division by zero.";
right_input = true;
}
if (!right_input) {
cout << var1 << " " << operation << " " << var2 << " = " << "Error;";
cout << "Invalid Operation!";
}
cout << endl;
system("pause");
return 0;
}
4 [ 5 (12 + 3) - 2 ] - 7
4 [ 5 (15) - 2 ] - 7
4 [ 75 - 2 ] - 7
4 [ 73 ] - 7
292 - 7
285