C Language Questions
Q31. Which header file is used for dynamic memory allocation in C
(a) math.h
(b) stdio.h
(c) conio.h
(d) stdlib.h
Answer: (d) stdlib.h
Q32. A preprocessor directive is always preceded by a symbol
(a) *
(b) //
(c) #
(d) %
Answer: (c) #
Q33. ______ return type cannot return any value to the caller
(a) int
(b) float
(c) void
(d) double
Answer: (c) void
Q34. A pointer variable of type _______ cannot be dereferenced
(a) int*
(b) char*
(c) float*
(d) void*
Answer: (d) void*
Q35. Dynamic memory management functions are defined in ______ header file
(a) stdio.h
(b) stdlib.h
(c) conio.h
(d) stdallo.h
Answer: (b) stdlib.h
Q36. A class binds the ____ and its related _____ together
(a) data, function
(b) information, messages
(c) constants, variables
(d) class, objects
Answer: (a) data, function
Q37. Break statement is most frequently used with in
(a) while
(b) it-else
(c) do-while
(d) switch-case
Answer: (d) switch-case
Q38. In C++ array subscript always starts with
(a) 0
(b) 1
(c) -1
(d) Any positive integer
Answer: (a) 0
Q39. In C++ << operator used for shifting bits can also be used for
(a) decrement
(b) increment
(c) addition
(d) displaying values
Answer: (d) displaying values
Q40. Which is the field width operator in C++
(a) endl
(b) set w
(c) new
(d) delete
Answer: (b) set w
Q41. C++ was developed by
(a) Ken Thompson
(b) Denis Richie
(c) Donald Knuth
(d) Bjarne Stroustrup
Answer: (d) Bjarne Stroustrup
Q42. Which one is not a primary constant in C
(a) Integer
(b) Float
(c) Union
(d) Character
Answer: (c) Union
Q43. Which one is not a keyword in C
(a) auto
(b) stop
(c) break
(d) static
Answer: (b) stop
Q44. Which function receives value from the key board
(a) getf()
(b) printf()
(c) scanf()
(d) send()
Answer: (c) scanf()
Q45. If a C program contains only one function, it must be
(a) getch()
(b) main()
(c) exit()
(d) void()
Answer: (b) main()
Practice Test Exam