Hmm.
Question 1: C is a low/mid/high level language. Depends largely on
context. Compared to assembly, it's high level. Compared to 4GLs, it's
low level. Most reasonable is mid-level, but how does one objectively
determine this?
Good answer
Question 3: True or false: "Computers understand C".
Computers understand nothing, at least yet; that's a concept reserved for
sentient beings.
Excellent.
Therefore false. On the other hand, if computers
didn't understand C, compilers wouldn't work, so the answer must be
true. On the other hand, the CPU probably doesn't deal with C directly
(I'm unaware of any that do, though I presume it's not impossible to
create one), so the answer must be true. On the other hand...
We're not worthy
er, shall we just flip a coin on this one?
Question 5: "Which language does NOT have a syntax similar to that of C":
C++, JavaScript, VB, Perl, Java.
Hmm. Frankly, none of them are particularly similar, IMO, but again,
it's a judgement call.
Oops. The clear answer is Visual Basic. All the others have a VERY
IMPORTANT feature, and this is explicit block structure. VB doesn't
have explicit block structure:
If a>b then
c = 0
else
d = 0
end if
As I show in my book, there is a "virtual" block structure. The "then"
keyword in VB both ends the if condition, disposing with C's, perl's
and Java's need for a curley brace, and starts a block that is ended
by the closest Else, which must balance in the same way as the curley
brace.
But this was a confusing add-in to an original Basic which was like
Fortran and assembler in that it used Go To to express block
structure. It works well once you know it (I've written a compiler in
VB) but it tends to expose the narrowness, incompetence, and utter
proviciality of C programmers who've learned only a syntactical rule,
and not what block structure actually means.
Question 7: Which is a valid C comment?
/* comment */
<!-- comment -->
/* /* comment */ */
// comment
' comment
Didn't C99 ratify the use of C++ style // comments? If so, how does one
pick two answers here?
Use your common sense and test-taking knowledge. Reason that in this
question, the narrower definition of C (which prohibits // comments,
as Heathfield reminded me) is meant.
If you can't deal with ambiguity, don't talk to end users.
Question 9: which is a valid "Hello, world" program?
I won't copy out all the options available, I'll simply note two issues:
none of them end the output with either a \n or an fflush, which in this
particular instance may not be such a big deal, but is piss-poor style...
but worse, none of them appear to have the requisite newline at end-of-
file, meaning none of them are valid.
What does "requisite" mean? If it means boo hoo I didn't see what I
wanted, welcome to the real world. Surely C is not THAT bad. Surely
you don't need a newline to push the last character out. Let me try
it...
int main()
{
printf("Goodbye, cruel world");
return 0;
}
No, it is not necessary.
Question 10: #include is a ??? command
Rootprocessor
Postprocessor
Preprocessor
...
AFAIK, it's not a command at all, so what does one answer here?
Now, this response is IDIOTIC, and its based on the Great Illusion of
the Dweeb: that unless words have fixed meanings, thought isn't
possible.
Question 11: To use printf, you need the ??? file:
idiots.h
stdio.h
stdio.c
studio.h
studio.c
None of the above; what you need is a valid prototype in scope. Aside
from that, nothing in C requires any of the standard includes to actually
be files, last I heard.
Oh, COME ON.
In a recent essay of Knuth, Knuth properly identifies the REAL
function of programming languages: to help human beings communicate
their intentions in using their computers.
If this wasn't necessary, you could wire plugboards or code machine
language!
But, human language is contextual, with ambiguity that is resolved
only when a communicative act is performed.
This is for the same reason, in fact, that what linguists call an
"open" part of speech can only be associated with a word when that
word is used: for example, in Hong Kong English, we can say "no
smoking I will crazy", using "crazy" not as an adjective but as a
verb. We can also say lan dak wu to, it's not easy to get stupid, but
das ist ein anders.
The fact is, that programmers, unless intimidated by fat thugs, use
words like "command" to refer to #include statements.
False precision is not fungible with regards to intelligence.
The vicious attacks here on good people like Herb Schildt and Jacob
Navia are the direct result of this fucking illusion about the nature
of human language.
Question 12: All C programs must have a ??? function:
man
min
root
goto
main
Correct answer: none of the above. Freestanding implementations, last I
checked, are allowed to have implementation-defined starting points.
Smartass. This means, in fact, that C is broken if it is true, for no
usable language depends upon external settings (compiler switches) for
its semantics. Many Options are a sign of sodom.
Question 15: Which of the following are data types?
car
triple
single
str
string
float
double
fraction
int
char
Hmm, potentially all of them. No way to know without seeing the code.- Hide quoted text -
Well, you have failed the test.