Hi all,
I got really confused by some of the questions on my homework, for example:
1)
|
for (a = 1; a <= 10; a++);
|
Does the semicolon at the end of the "for loop" statement represent a "Null statement"?
According to my understanding, the semicolon represent the "end" or "completion" of a statement, and a NULL represent a return of "0"? So the above code isn't a NULL statement right? I've came across another thread, and someone has stated that:
1 2 3 4
|
for (a = 1; a <= 10; a++)
{
; //represent null statement
}
|
Isn't both of the above codes the same thing?
Question 2)
Every input value "must" be checked for:
a)Its range/limits
b)Its reasonableness
c)If any zero division error
d)all of the above
e)none of the above
For this question, I chose "d" as the answer....I know "c" is a must, while "a" is somewhat must, but the problem is, i'm not sure if "b" is required.
Sorry for the newby questions, and Thank you all for the help :)