Sample Questions Discussion
I found Question 1 for Chapter 2 confusing.
Here is the text: "You want to declare an integer value called myVar and assign it the value 0. How can you accomplish this?
a) declare myVar as 0;
b) myVar = 0;
c) int myVar = 0
d) int myVar = 0;
I have chosen C, but the correct answer according to the book is B. I would understand it if the question was "You want to assign value of 0 to an integer variable called myVar". However, question states that you want to DECLARE it first. So not sure why B is correct answer. Please explain.