C/C MCQ Quiz Hub

C Programming - MCQ Questions Set 4

Choose a topic to test your knowledge and improve your C/C skills

1. Presence of code like “s.t.b = 10” indicates ____




2. Which of the following uses structure?




3. What is the correct syntax to declare a function foo() which receives an array of structure in function?




4. Presence of loop in a linked list can be tested by ________




5. Which option should be selected to work the following C expression? string p = "HELLO";




6. Which of the given option is the correct method for initialization? typedef char *string;




7. Which of the following is false about typedef?




8. Which of the following may create problem in the typedef program?




9.  typedef int (*PFI)(char *, char *)creates _________




10. What is typedef declaration?




11. The size of a union is determined by the size of the ______




12. Members of a union are accessed as______




13. Which of the following data types are accepted while declaring bit-fields?




14. Which of the following reduces the size of a structure?




15. Which of the following is not allowed?




16. Bit fields can only be declared as part of a structure.




17. Which among the following is the odd one out?




18.  For a typical program, the input is taken using _________




19. What does the following command line signify? prog1|prog2




20. What is the default return-type of getchar()?




21. What is the value of EOF?




22. What is the use of getchar()?




23. Which of the following statement is true?




24. What is the return value of putchar()?




25. Which is true about function tolower?




26. putchar(c) function/macro always outputs character c to the _____




27. The statement prog < infile causes _____




28. What is the difference between %e and %g?




29. Escape sequences are prefixed with ____




30. What is the purpose of sprintf?




31. The syntax to print a % using printf statement can be done by ____




32. Which of the following function with ellipsis are illegal?




33. Which of the following data-types are promoted when used as a parameter for an ellipsis?




34. Which header file includes a function for variable number of arguments?




35. Which of the following macro extracts an argument from the variable argument list (ie ellipsis) and advance the pointer to the next argument?




36.  The type va_list in an argument list is used _____




37. In a variable length argument function, the declaration “…” can _____




38. Each call of va_arg ____




39. What are the first and second arguments of fopen?




40. For binary files, a ___ must be appended to the mode string.




41. What will fopen will return, if there is any error while opening a file?




42. What is the return value of getc()?




43. When a C program is started, O.S environment is responsible for opening file and providing pointer for that file?




44. In C language, FILE is of which data type?




45. What is meant by ‘a’ in the following C operation? fp = fopen("Random.txt", "a");




46. Which of the following mode argument is used to truncate?




47. Which type of files can’t be opened using fopen()?




48. Which of the following fopen() statements are illegal?




49. What does the following segment of C code do? fprintf(fp, "Copying!");




50. What is FILE reserved word?