How are operands and operators in the following expression associated?
Insert parentheses to form equivalent expressions.
x = -4 * i++ - 6 % 4;
x = ( ((-4) * (i++)) - (6 % 4) )
What value will be assigned in part a to the variable x if the variable i has a value of -2?
The value 6 will be assigned to the variable x.
#include <iostream> using namespace std; int main()/*from w w w. j a v a 2 s. c o m*/ { int i = -2; int x = -4 * i++ - 6 % 4; cout << x << endl; i = -2; x = (((-4) * (i++)) - (6 % 4)); cout << x << endl; return 0; }