Originally Posted by
matthayzon89
The answer is C=2.
Yes, though be careful: names in C are case sensitive.
Originally Posted by
matthayzon89
Terminates means after the code is interpreted and before the program starts running, right?
No. It means the point just before the main function returns (i.e., the program is already running). If you did what I told you to do, it would be:
Code:
#include <stdio.h>
int main() {
int a,b,c;
a = 4;
b = a-2;
if (a > b)
c = b;
else
c = 8;
printf("%d\n", c); /* this point */
return 0;
}
So on paper, you should mentally (or with a pen/pencil) mark that line.
Originally Posted by
matthayzon89
Sometimes its hard to understand what these questions are asking, and if I miss interpret it in my head and I get the logic correct for my interpretation, i end up getting the question WRONG. grrrrrrrrrr.
To be honest, the second question is not a good one: it requires you to interpret 12 < points < 25 as mathematical notation, but strictly speaking the expression is a valid C expression.