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))));
1
Expert's answer
2014-05-22T09:16:40-0400
#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 the first!
LATEST TUTORIALS
APPROVED BY CLIENTS