C Programming MCQ Questions and Answers Part – 2
51. What is the ASCII range for A to Z letters?
A. 65 to 90.
B. 48 to 57.
C. 97 to 122
D. 86 to 98.
52. The escape sequence \t is a_________.
B. next line.
D. skip the line.
53. Which is the correct statement for finding the cube of 2?
54. The abs() function displays________.
A. absolute value.
B. negative value.
C. zero value.
D. positive value
55. The switch statement is used to________.
A. switch between functions in a program.
B. switch from one variable to another variable.
C. choose from multiple possibilities which may arise due to different values of a single variable.
D. use switching variables.
56. The default statement is executed in switch case when________.
A. all the case statements are false.
B. one of the case is true.
C. one of the case is false
D. all the case statements are true.
57. Each case statement in switch () is separated by______.
58. The keyword else can be used with________.
A. if statement.
B. switch() statement.
C. do while statement.
D. if..else statement
59. How many while statements are possible in do..while loop?
60. An array is a collection of_________.
A. different data types.
B. same data types.
C. different data types.
D. only one data type.
61. ++ is ____ operator
A. a binary
B. a unary
C. a assignment
D. a logical
62. A character array always ends with________.
A. null (\0) character.
B. question mark (?).
C. full stop(.).
D. exclamation mark(!).
63. If you delete array without stating the elements it will be set to________.
A. a null value.
C. garbage value
D. no value.
64. Arrays cannot be initialized if they are________.
65. All the elements in the array must be________.
C. initialized, defined.
66. The string always ends with__________.
A. \0 character.
C. 0\ character.
D. 0 character.
67. The fastest way to exchange two rows in a two-dimensional array is________.
A. exchange the addresses of each element in the two rows.
B. exchange the elements of the two rows.
C. store the addresses of the rows in an array of pointers and exchange the pointers.
D. exchange both address and pointers in each row.
68. Which header file is essential for using strcmp() function?
69. Arrays are passed as arguments to a function by_________.
C. value, reference.
70. It is necessary to declare the type of a function in the calling program if _______.
A. the function returns a non-integer value.
B. the function returns an integer.
C. the function is not defined in the same file.
D. the function is defined in the same file.
71. Recursion is a process in which a function calls _________.
B. another function.
C. main( ) function.
D. sub program.
72. By default the function returns_______.
A. integer value.
B. float value.
C. char value.
73. The meaning of keyword void before the function name means________.
A. function should not return any value.
B. function should return a value.
C. no arguments are passed.
D. some arguments are passed
74. The function name itself is_________.
A. an address.
75. A global pointer can access variable of________.
A. all user-defined functions.
B. only main() function.
C. only library functions.
D. external functions.
76. Which among the following is a unconditional control structure?
77. A static variable is one that________.
A. retains its value throughout the life of the program.
B. cannot be initialized.
C. is initialized once at the commencement of the execution and cannot be changed at the run time.
D. is same as an automatic variable but is placed at the head of the program.
78. An external variable is one_______.
A. which is globally accessible by all functions.
B. which is declared outside the body of any function.
C. which resides in the memory till the end of the program.
D. which is locally accessible by all functions.
79. If a storage class is not mentioned in the declaration then default storage class is_________.
80. If the CPU fails to keep the variable in CPU registers, in that case the variables are
81. Identify the most appropriate sentence to describe the unions_______.
A. unions contain members of different data types which share the same storage area in memory.
B. unions are like structures.
C. unions are less frequently used in the program.
D. unions are used for set operations.
82. The member variable of structure is accessed by using______.
A. dot (.) operator.
B. arrow (->) operator.
C. asterisk * operator.
D. ampersand & operator.
83. The structure combines variables of_______.
A. similar data types.
B. dissimilar data types.
C. unsigned data types.
D. signed data types.
84. The typedef statement is used for________.
A. declaring user-defined data types.
B. declaring variant variables.
C. for typecasting of variables.
D. for typing static variables.
85. The number of bytes required for enumerated data type in memory are________.
A. 1 bytes.
B. 4 bytes.
C. 2 bytes.
D. 3 bytes
86. Which data type is most suitable for storing a number 65000 in a 32-bit system?
87. Which of the following is not a correct variable type?
88. The number of digits present after decimal in float is________.
89. In a 32-bit compiler, which 2 types have same size? B. C. D.
A. char and int.
B. int and float.
C. short and int.
D. float and double.
90. The union holds_______.
A. one object at a time.
B. multiple objects.
C. different objects.
D. two object.
91. Bit fields are used only with________.
A. int data type.
B. float data type.
C. char data type.
D. unsigned int data type.
92. The fscanf () statements reads data from________.
93. When fopen () fails to open a file it returns______.
94. A file opened in w+ mode can be________.
B. only read.
C. only write.
D. only close.
95. Command line arguments are used to accept argument from________.
A. command prompt of operating system.
B. . through scanf( ) statement.
C. both (a) and (b).
D. through printf() statement
96. The redirection operator > transfers any output to________.
A. text file.
C. binary file.
D. number file.
97. This function is used to detect the end of file________.
A. feof( ).
B. ferror( ).
C. fputs( ).
D. fgetch( ).
98. The EOF is equivalent to_______.
99. The scanf() statement is an_______.
100. what is file?
A. collection of records.
B. collection of arguments.
C. group of arguments