![]() |
Multiple Choice Questions in C (Answers not given)
1.
Code: C
b. 0 1 2 c. 1 2 3 d. None of the above 2. Code: C
b. 123 123 c. 456 456 d. 456 123 3. Code: C
b. Fatal Error c. 0 4 d. System Hangs 4. Code: C
b. 0 Some Value c. Error c. None of the Above 5. Code: C
b. Garbage Value 1 b. 0 1 d. 1 2 6. Code: C
b. Compilation Error c. Runtime Error d. Linker Error 7. Code: C
b. Garbage Value 20 c. 0 20 d. Linker Error 8. Code: C
b. 300 -200 300 10 4 c. -200 300 10 4 0 d. 100 -200 300 4 10 9. Code: C
b. 0 c. No Output d. Error 10. Code: C
b. No Output c. 6 4 2 d. 5 2 11. What will be the output of the following program : Code: C
b. 1235 1235 c. 1234 1235 d. 1235 1234 12. What will be the output of the following program : Code: C
b. 0.0 0.0 0.0 0.0 0.0 c. 0.0 0.1 0.2 0.3 0.4 d. 1.0 1.0 1.0 1.0 1.0 13. What will be the output of the following program : Code: C
b. Testing...Done c. Testing...Done Testing...Done d. None of these 14. A signed int bitfield 1-bit wide can only hold the values a. 0 and 1 b. 0 and -1 c. 0, 1 and -1 d. None of these 15. Code: C
b. Linker Error c. Run Time Error d. Compiler Error 16. Code: C
b. Default1Case1 c. Default2 d. Default1 17. Code: C
b. 5 3 c. 3 5 d. 5 0 18. Evaluate the following: Code: C
b. 11 c. 1 d. 0 19. What does the line containing "break;" do in the following code? Code: C
b. Exits the function c. Compiler error d. Nothing 20. What does the following code do? Code: C
b. Outputs 10 c. Outputs the address of v d. No Output 21. If a machine architecture assigns 4 bytes to store the address of a variable, what should be the output of the program stated below? Code: C
b. 4 4 c. 4 1 d. 1 1 22. What would be the output of the following? Code: C
b. 200 c. Compiler Error d. None of the above 23. What would be the output of the following? Code: C
b. B c. All the above d. None of the above 24. What would be the output of the following? Code: C
b. 11 c. Error d. Garbage Value 25. If the following program(myprog) is run from the command line as myprog mon tue wed thu, what would the output? Code: C
b. mon tue wed thu c. myprog tue thu d. tue thu 26. What is the type of variable f2 and p2 in the following declaration? #define floatptr float * #define int * intptr floatptr f1,f2; intptr p1,p2; a. float, int pointer b. float pointer, int pointer c. float, int d. float pointer, int 27. What would be the output of the following? Code: C
b. 0 c. Garbage Value d. Error 28. If the following program(myprog) is run from the command line as myprog fri tue sun, what would the output? Code: C
b. f c. s d. None of the above 29. What would be the output of the following? Code: C
b. 12 c. 10 d. 11 30. What would be the output of the following? Code: C
b. lo c. llo d. Error 31. Code: C
a. It will work correctly since the for loop covers the entire list. b. It may fail since each node “nptr” is freed before its next address can be accessed. c. This is invalid syntax for freeing memory d. The loop will never end 32. In C, what is the difference between a declaration and definition of a variable? a. Both can occur multiple times, but a declaration must occur first. b. Both can occur multiple times, but a definition must occur first. c. A definition occurs once, but declaration may occur many times. d. A declaration occurs once, but definition may occur many times. 33. What would be the output of the following? Code: C
b. 22 11 11 11 c. 22 10 11 13 d. 22 13 13 13 34. sizeof is an ________________ a. int b. unsigned int c. long int d. Anyone of the above 35. . and -> are __________ operators. a. Binary b. Unary c. Ternary d. None of the above 36. What would be the output of the following? Code: C
b. 1234 01234 c. 1234 668 d. 1234 688 37. chmod() function is defined in which header file? a. assert.h b. dos.h c. io.h d. Mem.h 38. The header file which includes stdarg.h is_____________ a. assert.h b. dos.h c. io.h d. Mem.h 39. _______________ is a direct interface to the DOS call 0x44 a. ioctl b. ios c. dup d. tell 40. What would be the output of the following? Code: C
b. 3 c. 2 d. 1 41. What would be the output of the following? Code: C
b. 7ld 8ld 7ld 8ld c. 10ld 7ld 10ld 7ld d. Error 42. longjmp cannot pass the value ________. a. -1 b. 0 c. 1 d. 2 43. Scope of a global variable which is declared as __________ is within the file. a. static b. extern c. register d. function argument 44. What value is returned by abort function? a. Depends on the parameter passed b. 3 c. Depends on the Operating System d. 0 45. What would be the output of the following? Code: C
b. 100 100 c. 0 100 d. 1 100 46. What would be the output of the following? Code: C
b. 10 c. Error d. Garbage Value 47. What would the output of the following? Code: C
b. 7 -1 c. 7 0 d. 5 1 48. What would be the output of the following? Code: C
b. eMissi ssippiz c. Mississippi d. Missi 49. Format specifier %p is used for _______________ a. Print the address contained in a pointer variable b. Peak a value at a location c. Print the address in segment: offset notation d. Same as %d 50. What would be the output of the following program? Code: C
b. I Love You c. malloc() fails d. strcpy() fails 51. What would be the output of the following? Code: C
b. 0 c. Error d. No output 52. What would be the output of the following? Code: C
1 0 1 1 0 2 1 0 2 b. 0 1 1 1 1 1 1 1 1 c. 1 2 3 2 2 3 2 3 3 d. 1 0 1 1 0 1 1 1 2 53. What would be the output of the following? Code: C
b. 5 9 13 17 c. 12 17 22 d. 16 21 54. What would be the output of the following? Code: C
b. 27 4 c. 27 6 d. 64 6 55. What would be the output of the following? Code: C
b. 4 c. 16 d. None of the above 56. What would be the output of the following? Code: C
b. 12 c. 100 d. Compiler Error 57. What would be the output of the following? Code: C
b. 0.50 c. 0.00 d. -0.50 58. Which one of the following describes the chief difference between a structure and a union? a. The fields of a structure overlap each other in memory; the fields of a union are allocated sequentially. b. The compiler pads structures for word alignment; the compiler allocates exactly enough space for a union to hold all of its fields. c. A union may contain bitfields; a structure may not. d. The fields of a structure exist concurrently; the fields of a union do not. 59. What would be the output of the following? Code: C
b. 5 c. 6 d. None of the above 60. f = fopen( fileName, "r" ); Code: C
a. fclose( f ) b. f == -1 c. f != 0; d. f == NULL |
Re: Multiple Choice Questions in C (Answers not given)
Now we have quite a few questions in C-C++.
100 Multiple choice questions in C Top 100 C Questions Asked in Actual Interviews |
Re: Multiple Choice Questions in C (Answers not given)
very useful to my interview sir
|
Re: Multiple Choice Questions in C (Answers not given)
hry guys, i have solved almost all ques. m attaching file. please check if any answer is not correct...
will surely post remaining ques later... Code:
1. a |
Re: Multiple Choice Questions in C (Answers not given)
Don't you think that would be a spoiler.
|
Re: Multiple Choice Questions in C (Answers not given)
I dont want to say whether answers are correct or not. Few questions are implementation dependant.Always you could execute and see and then try to find out reason behind the anwer. I feel that would be best way to learn
|
Re: Multiple Choice Questions in C (Answers not given)
Why to be a spoiler. I thought that would just test my knowledge in C and would provide answers that are a bit confusing to those who do not know it? So to me it lot more useable than to those whom its spoiler.
|
Re: Multiple Choice Questions in C (Answers not given)
Quote:
|
Re: Multiple Choice Questions in C (Answers not given)
Could you please explain to me the questions #10, #17 and #20?
#10 why does the loop ends? #17 why does 3+big(a,b) is different than big(a,b)+3 ? #20 The line x=new int; gives me 4 errors and 1 warning in my compiler. Thank you |
Re: Multiple Choice Questions in C (Answers not given)
Quote:
Quote:
Quote:
|
| All times are GMT +5.5. The time now is 10:32. |