C Language MCQs
1. Who is the father of C language ?
a) Bjarne stroustrup
b) James A.gosling
c) Dennis ritchie
d) Dr. e.f codd
2. How many keyword’s in C ?
a) 0
b) 32
c) 48
d) 255
3. How many types of loop in C?
a) one
b) two
c) three
d) none
4. Which of the following function is user defined ?
a) printf
b) scanf
c) main
d) none
5. Void occupy how many bytes in memory ?
a) 0
b) 1
c) 2
d) 4
6. In C, we used for input/output ?
a) cin & cout
b) input & output
c) scanf & printf
d) Both b & c
7. What is the range of int data type ?
a) 0to 255
b) -127 to +128
c) -32768 to +32767
d) none
8. What is the range of char data type ?
a) 0to 255
b) -128 to +127
c) 0 to 127
d) none
9. In which year, C Language was Developed?
a) 1979
b) 1972
c) 1991
d) 1995
10. Which type of Language is C ?
a) Procedural oriented programming
b) object oriented programming
c) Semi-object oriented programming
d) none
11. The format identifier ‘%c’ is used for which datatype ?
a) int
b) double
c) char
d) float
12. size of () is a ?
a) function
b) variable
c) Both a & b
d) operator
13. Break statement is used for ?
a) Quit a program
b) Quit the current itration
c) Both a & b
d) none
14. Is it possible to run program without main() ?
a) Yes
b) No
c) error
d) Can’t say
15. Which of the following is a logical NOT operator ?
a) ||
b) &&
c) !
d) +
16. what is the default value of local variable?
a) 0
b) 1
c) garbage
d) null
17. What is the default value of static variable ?
a) 0
b) null
c) garbage
d) none
18. Which of the following will not return a value?
a) void
b) int
c) null
d) char
19. Is const better than #define?
a) Yes
b) No
c) Can’t say
d) none
20. Can we assign null on void pointer ?
a) Yes
b) No
c) error
d) none
21. Prototype of a function means ?
a) Name of function
b) Parameter of function
c) Declaration of function
d) All
22. float a[15] , what is the size of array ?
a) 17
b) 64
c) 16
d) 60
23. Variable that are declared but not initialized contains,_____________?
a) 0
b) Blank space
c) garbage
d) none
24. Which of the following is not a valid storage class?
a) auto
b) extern
c) dynamic
d) register
25. Which type of statement is ‘break’ in C language?
a) Conditional statement
b) Jump statement
c) Looping statement
d) All of above
26. What is the scope of local variable ?
a) Entire program
b) Within the block or function
c) Only main function
d) All of above
27. Which operator is used to access value at address stored by a pointer variable?
a) *
b) &
c) #
d) @
28. Which of the following user-defined datatype share it’s memory each other ?
a) structure
b) union
c) class
d) array
29. Which pre-defined function is used for comparing two strings?
a) strepy()
b) strcat()
c) strrev()
d) strcmp()
30. Which standard liberary file printf & scanf are located ?
a) conio.h
b) string.h
c) math.h
d) stdio.h
31. Can we print normal variable inside static function ?
a) Yes
b) No
32. How many way to calling of function in C language ?
a) two
b) three
c) four
d) one
33. Which of the following is more memory efficient ?
a) structure
b) union
c) Both a & b
d) Depends on system
34. Which of the following is the correct operator to compare two variables?
a) =
b) !=
c) equal
d) ==
35. Which of the following is the correct comment ?
a) ** comment **
b) */ comment*/
c) /* comment */
d) { comment }
36. What is the index number of the last element of an array in 5 elements?
a) 5
b) 0
c) 3
d) 4
37. The parameters specified in the function call are called parameters?
a) Actual
b) Formal
c) value
d) all
38. Which type of loop are while and for ?
a) Entry control
b) Exit control
c) both
d) none
39. What is the ASCII value of space character ?
a) 32
b) 0
c) 65
d) 255
40. Logical expressions produce type results ?
a) explicit
b) garbage
c) bool
d) static
41. If int a=5/2; will return a value ?
a) 2.5
b) 2.0
c) 3
d) 2
42. By default how the values are passed to the function ?
a) Call by value
b) Call by reference
c) Call by pointer
d) All of above
43. C language developed at_________________
a) AT & T’s Bell lab
b) Sun micro system
c) Cambridge university
d) none
44. C programs are converted into machine language with the help of ?
a) An editor
b) A compiler
c) An operating system
d) None of these
45. C was primarily developed as ?
a) System programming
b) General purpose
c) Data processing
d) none
46. Which of the following is not a reserved keyword for C ?
a) auto
b) case
c) main
d) default
47. Which one of the following is not a valid indentifier ?
a) _a;
b) 1a;
c) a_b;
d) a1;
48. Which is the only function all C programs must contain ?
a) system()
b) start()
c) main()
d) getch()
49. Which of the following is not a correct variable type ?
a) double
b) int
c) char
d) real
50. Which loop execute at_least once even condition is false ?
a) do while
b) while
c) for
d) for_each
51. strlen() is used for ?
a) Calculate string length
b) Reverse string
c) Concat two strings
d) Copy string
52. Which operator is known as ternary operator ?
a) ::
b) ;
c) :
d) ?:
53. Recursive functions are executed in a ?
a) FIFO order
b) Load balancing
c) parallel
d) LIFO order
54. Which of the following are example of iteration in C?
a) for
b) while
c) do-while
d) all of above
55. Which keyword can be used for coming out of recursion?
a) break
b) exit
c) return
d) none
56. Associativity of an operator are ?
a) Left to right
b) Right to left
c) Random
d) Both a & b
57. Automatic variable are initialized with by default?
a) 0
b) garbage
c) blank
d) none
58. Can we overload function in C?
a) Yes
b) No
c) Can’t say
d) none
59. How many logical operator in C?
a) one
b) two
c) three
d) none
60. What is the return type of printf & scanf function?
a) void
b) int
c) char
d) bool
61. int **ptr is ?
a) pointer
b) pointer to integer
c) invalid
d) pointer to pointer
62. What is the return_type of sqrt() ?
a) int
b) float
c) double
d) depends on the datatype of parameter
63. Can function definition be present in header files ?
a) yes
b) no
c) Depends on compiler
d) none
64. Is initialization mandatory for local static variables?
a) Yes
b) No
c) Depends on compiler
d) none
65. All keywords in C are in ?
a) LowerCase letters
b) UpperCase letters
c) CamelCase letters
d) none
66. Which of the following function is pre-defined ?
a) print()
b) input()
c) main()
d) sqrt()
67. Difference between ASCII value of Upper & Lower case of the same letter is, ?
a) 0
b) 32
c) 48
d) 255
68. What is the size of struct always?
a) Equal to it’s Biggest data member size
b) Equal to sum of it’s all data member size
c) Equal to it’s Smallest data member size
d) none
69. Which Datatype will throw an error when we perform modulus operation(%)?
a) int
b) short
c) float
d) All of above
70. float occupy how many bytes in memory ?
a) 0 byte
b) 1 byte
c) 2 bytes
d) 4 bytes
71. C language is which language subset?
a) java
b) python
c) C++
d) C#
72. Automatic variables are stored in__________
a) Stack
b) Heap
c) Register
d) none
73. An uninitialized pointer is called ?
a) Void pointer
b) Null pointer
c) Dangling pointer
d) Wild pointer
74. A pointer that is initialized NULL value is called ?
a) Null pointer
b) Wild pointer
c) Function pointer
d) Pointer to pointer
75. A function can be defined inside another function?
a) true
b) false
c) can’t say
d) none
76. A function can be called inside a another function?
a) true
b) false
c) none
d) Both a & b
77. Declaration of single line comment is ?
a) /*
b) */
c) //
d)/* */
78. How many type of comments are in C?
a) one
b) two
c) three
d) four
79. The maximum number of arguments that can be passed in a single function ?
a) 127
b) 0
c) 255
d) 253
80. How many types of assignment operator in C ?
a) One
b) Two
c) Three
d) None
81. The format identifier ‘%i’ is used for which datatype ?
a) int
b) double
c) char
d) float
82. Every function must return a value?
a) Yes
b) No
c) Can’t say
d) None
83. Which keyword is used to come out of a loop only for that itration ?
a) break
b) continue
c) exit
d) return
84. Result of logical expression in C is?
a) true
b) false
c) 0 or 1
d) All of above
85. A variable that is declared inside another function can be used in main()?
a) Yes
b) No
c) Only for that function
d) Both b & c
86. C preprocessors are specified with ?
a) $
b) ::
c) ;
d) #
87. How many type of macros in C?
a) one
b) Two
c) Three
d) No any macros
88. Which loop is best to perform the operation then test the condition?
a) for loop
b) while loop
c) do while loop
d) No any loop
89. How many types of Datatype in C ?
a) One
b) Two
c) Three
d) four
90. Which of the following is primary Datatype?
a) struct
b) class
c) enum
d) int
91. Escape sequences are prefixed with __________?
a) %
b) /
c) \
d) :
92. Which of the following is not an operator?
a) ,
b) size of
c) Il
d) none
93. In C, which function we use to clear the console?
a) getch()
b) clearscreen()
c) clrscr()
d) clearscr()
94. In which Datatype the size is not fixed?
a) int
b) float
c) struct
d) double