64 665
Assignments Done
99,2%
Successfully Done
In September 2018

Answer to Question #42581 in C++ for arpit

Question #42581
State the order of evaluation of the operation in each of the following c++ statement and implement them to show the value of x after each statement.
X=7+3*6/2-1;
X=2%2+2*2-2/2;
X=(3*9*(3+(9*3/(3))));
Expert's answer
#include <iostream>
using namespace std;
int main () {
int X = 0;
X = 7 + 3 * 6 / 2 - 1;
cout << "X = 7+3*6/2-1 = " << X << endl;
X = 2 % 2 + 2 * 2 - 2 / 2;
cout << "X = 2%2+2*2-2/2 = " << X << endl;
X=(3*9*(3+(9*3/(3))));
cout << "X = (3*9*(3+(9*3/(3)))) = " << X << endl;
return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions