Hi ,
Anyone Please post some tricky questions on C or Links for C quiz..
It will be helpful 4 me..
Thanks in Advance..
Printable View
Hi ,
Anyone Please post some tricky questions on C or Links for C quiz..
It will be helpful 4 me..
Thanks in Advance..
But the first one is definitely not good:
These definitely do not have the right answer:
http://www.geekinterview.com/quiz/review/16/1258.html
http://www.geekinterview.com/quiz/review/16/1260.html
http://www.geekinterview.com/quiz/review/16/1264.html
These are a bit dodgy (may or may not be correct answer, depending on circumstances):
http://www.geekinterview.com/quiz/review/16/1265.html
These are compiler-dependant (compiler appears to be 16-bit in this case):
http://www.geekinterview.com/quiz/review/16/1268.html
http://www.geekinterview.com/quiz/review/16/1270.html
That's after about half of the 52 questions.
--
Mats
thanks 4 ur post... Geekinterview was helpful..
Those questions are terrible, NOT worth looking at.
This website has a nice quiz, why not use that?
Thanks 4 sharing ....
If u know , u just post me some other links too
Jeez, Geekinterview is one sorry-assed site.
Every program needs to begin with
#include <ancient_1980s_assumptions.h>
Hi everyone,
I set up a small C quiz some time ago, see http://www.0xe3.com/quiz/.
The questions/answers are fully ANSI/ISO C9x compliant, but I like to restrain from C99-specific stuff. I'd be glad to hear your comments, or better yet, see you add some questions.
Greets,
Philip
It would be nice to get a summary of the result on the final page, don't you think?
Some of the questions are quite obscure (e.g. dealing with undefined behaviour that isn't entirely obvious to most people). I think there could be some more basic ones.
Edit: And for fun, it would be nice to see what the percentage answers for each of the incorrect options where once the answer is given (e.g. when the right answer is given 30.9% of the time, what percentage cover was of the other 2 answers).
--
Mats
Also, quiz question 0x06a should probably rename the third answer to "undefined", since the current answer is sort of implying that the reader don't know the answer...
--
Mats
Well the first question and answer is misleading and wrong all at the same time.
> If C is 1, what is C++?
Now the answer (2) is only true at the next sequence point. In a more general context of say
a = c++;
asking what is 'c' takes on a whole new meaning. Like what is 'c' at the point of the assignment.
And then there's the answer...
> The "++"-Operator increments decimal values by one.
WTF has decimal got to do with it?
++ works on doubles, as well as pointers.
Further, saying c = 0x1234; doesn't suddenly break your ability to do c++ on it.
Oh, and the whole "deref" and "question++" thing is way too geeky.
The answer to Q15 is wrong.
"If it's missing, main() shall implicitly return 0 after completion."
This magical hack is only true of C++. In C, you return garbage, which has the same disasters awaiting it as if main was declared void.
It is also correct with respect to the 1999 edition of the C standard.Quote:
Originally Posted by Salem
Hi everyone,
thanks for your input, I really appreciate that.
You are right, I will work on that tomorrow.Quote:
It would be nice to get a summary of the result on the final page, don't you think?
In fact, most questions/answers submitted by other people are what you'd call "basic", but the purpose of the quiz actually is to show people that they don't know much about C even if they think they do. I find it boring if quizzes start with questions that everyone will know after having read the first ten pages of a good book on C. There are already plenty of such quizzes out there.Quote:
Some of the questions are quite obscure (e.g. dealing with undefined behaviour that isn't entirely obvious to most people). I think there could be some more basic ones.
Similar arguments hold for undefined behaviour: this is one of the most basic concepts the various C standards suggest. I keep getting angry seeing code that tries to fflush(stdin), let alone not checking return values of functions, e.g. malloc(). If the person taking the quiz is confused by the term "undefined behaviour" or its consequences, there's Google.
That's a wonderful idea, haven't thought of it by now. Right now, the database only stores positives and fails, but I'll simply break the fails in two parts of roughly the same size and it will adjust itself in a few days. For some of the questions, the results sure will be fun to analyze.Quote:
And for fun, it would be nice to see what the percentage answers for each of the incorrect options where once the answer is given
That's because the reader doesn't know the answer. "Undefined" is actually wrong, because if there are arguments and/or program name available from the host environment, the behaviour is absolutely well defined. A truly correct answer would be "Undefined if argument/name isn't available", but this seems too obvious.Quote:
Also, quiz question 0x06a should probably rename the third answer to "undefined", since the current answer is sort of implying that the reader don't know the answer...
I'm sure you have chosen the right answer anyway.Quote:
> If C is 1, what is C++?
Now the answer (2) is only true at the next sequence point.
Of course your argument is true, but this question is just an opener, hopefully arousing interest in completing the quiz. When I started the quiz, I actually gave it 100 positive attempts to make sure it appears as the first question.
Right, but pointless. If you are pedantic, let me be pedantic too: 0x1234 is a decimal _value_ in a hexadecimal _representation_.Quote:
> The "++"-Operator increments decimal values by one.
WTF has decimal got to do with it?
++ works on doubles, as well as pointers.
Further, saying c = 0x1234; doesn't suddenly break your ability to do c++ on it.
But it's ugly, so I corrected it. :-)
Read the explanation again. In the same sentence, it states that C99 doesn't require main() to return explicitly. For your reassurance, I modified the right answer to "Yes, since C99".Quote:
"If it's missing, main() shall implicitly return 0 after completion."
This magical hack is only true of C++.
That's on purpose. No "geek" will be able to answer more than 5 questions correctly.Quote:
Oh, and the whole "deref" and "question++" thing is way too geeky.
Except for this one, there's only one other page that links to my quiz; the majority (>90%, a shabby 1000 unique visitors per month) gets there by googling for "c programming quiz" and the like. I tell that because obviously, these persons show some specific interest in taking a C quiz. To me, this sounds pretty geeky. Of these people, only about 10% manage to get to the last question, so either the quiz is too easy (no), too hard (yes) or too boring (can't be). Conclusion: in my opinion there's nothing geeky whatsoever about the quiz itself. Having the buttons labeled in an ironical manner is my way of amusing the reader, if he isn't already by the surprisingly low percentage of people who were able to choose the right answer.
Salem, you sound a bit angry. Everything ok with you? If there are problems with the quiz, I'll correct them as soon as I can. The quiz is supposed to make you happy... :-)
Again, thanks for your quick responses. I hope there's more to come...
Greets,
Philip