C Programming MCQ-4

C Programming MCQ Multiple Choice Questions and Answers


1. By default a function returns a value of type




Answer : C


2. Which of the following are a collection of different data typed ?




Answer : B


3. Which of the following can never be sent by call by value ?




Answer : B


4. Collection of similar data type is _______




Answer : A


5. Which function is used to release the memory allotted in dynamic memory allocation ?




Answer : A
Explanation : Malloc() function in C is used to dynamically allocate a block of memory with specified size.


C Programming MCQ

6. Member of union use :




Answer : B
Explanation : Unions provide an efficient way of using the same memory location for multiple-purpose.


7. Which of the following is example of call by value ?




Answer : B


8. How many elements can be store in the array A[35] ?




Answer : A


9. An array is a collection of :




Answer : B


10. If int S[5] is a one-dimensional array of integers, which of the following refers to the third element in the array ?




Answer : A


C Programming MCQ

11. Which you pass an array as an argument to a function, what actually gets passed ?




Answer : C
Explanation : When we pass an array as a funtion argument, it will pass only base address i.e. address of first element of array.


12. What is the difference between the 5’s in these two expressions? int num[5]; num[5]=11; select the correct answer.




Answer : B


13. What will happen if you assign a value to an element of an array whose subscript exceeds the size of the array?




Answer : C
Explanation : The program may crash if some important data gets overwritten.


14. Given the statement maruti. engine. bolts=25; which of the following is true ?




Answer : B


15. An array elements are always stored in _________ memory locations.




Answer : A




Related Links

Leave a Comment

Your email address will not be published.