what is the price of variable x given in the following command x=f(3,3,4);
which f declared as following:
int f(int q, int b, int c)
{ int p;
p = q * b + 2 * c;
return (p);
}
thanks
Last edited on
I think must be 17 - (p=3*3+2*4)=17
Multiplication has a higher precedence than addition so:
p = q * b + 2 * c
= (3 * 3) + (2 * 4)
= 9 + 8
= 17