My site is home to series of quizzes ranging from Accounting,
Business, Math to programming languages. These are multiple choice
type questions and you get a score card at end.
For C language, I have 3 set of quizzes that anyone is welcome to try
online for free.
Questions on C quizzes are rather easy to solve for Professional C
programmers yet for those who are taking C as a first programming
course will find these useful in assesment their C
knowledge
Visithttp://
www.thinkanddone.com/exams/main.aspx
Regards
Asad S. Yousaf
Some of the questions could be better worded, and some of the
questions are just plain wrong.
--------------
Dataset 1
--------------
Question 1 states: A C program is a collection of ______________
(a) arrays
(b) variables
(c) functions
(d) data types
Neither of these answers are correct, though you state that (c) is the
answer. A C program is more than a collection of functions. What
about object declarations? Type declarations? The correct answer
should be "declarations".
Question 3 states: Its given that variable x has been assigned a value
of 5, which of the following statement will output the message "I am
quite right"
(a) if (x!=5) printf("I am quite right");
(b) if (x=5) printf("I am quite right");
(c) both statements will display the message
(d) none of the above
You give answer (d) as the correct answer, when in fact the correct
answer is (b). Remember, assignment expressions have a value too...
Question 6: I don't like the wording of this question. The term
"assignment" here I think is not really correct
---------------
Dataset 2
---------------
Question 1: This may just be a language barrier issue, but
"alphabets" should be "letters"
Question 5: I'm not sure that you should be so dogmatic about the use
of infinite loops. They should not be used if you can avoid them, but
I know Linux uses them a lot. Perhaps there are cases where you need
to use them...
Question 8: This may be bit-picking, but my interpretation of the
Standard is that void actually *is* a value, but it is an empty value
that cannot be used. I would be interested to know why this
description was used. Why not just say void means "returning no value"
Question 9: Sorry, your answer is wrong. You declare an array of 10
characters. You can fit 10 characters in it. The answer is not 9.
There is no rule that the last element of an array of char must be a
null character. And even if there was, the null character is *still*
a character!
--------------
Dataset 3
--------------
Question 2: Replace the word "commands" with "directives"
Question 3: Where is the condition contained in round brackets?
Question 6: Answer (d) is correct, not answer (c)
Question 7: Answer (c) is given as correct, but goto is not a loop
statement
Question 8: A function *always* returns one value. Just because it
is a pointer does not mean that it returns *many* values
Question 9: All arguments are pass by value
Question 10: 12 bytes is incorrect. The value is implementation
defined, because a structure may have any amount of padding between
its members or following the last member.
Regards,
B.