Can anyone advice me about what is the price of variable x given

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
42 (lol)
I think must be 17 - (p=3*3+2*4)=17
closed account (z05DSL3A)
Multiplication has a higher precedence than addition so:

p = q * b + 2 * c

= (3 * 3) + (2 * 4)

= 9 + 8

= 17
yes.
Topic archived. No new replies allowed.