Report Bug

QusDifference between calloc() and malloc() is: QusDifference between calloc() and malloc() is:


A. calloc() takes a single argument while malloc() needs two arguments
B. malloc() takes a single argument while calloc() needs two arguments
C. malloc() initializes the allocated memory to ZERO
D. calloc() initializes the allocated memory to NULL


Solution
B. malloc() takes a single argument while calloc() needs two arguments



Explanation
The malloc() takes a single argument, while calloc() takess two. Second, malloc() does not initialize the memory allocated, while calloc() initializes the allocated memory to ZERO.Both malloc and calloc are used in C language for dynamic memory allocation they obtain blocks of memory dynamically.
Online Exam Quiz for One day Exam Online Typing Test CCC Online Test 2026 Best Computer Training Institute in Prayagraj (Allahabad) Best Java Training Institute in Prayagraj (Allahabad) Best Python Training Institute in Prayagraj (Allahabad) O Level Online Test in Hindi Best Website and Software Company in Allahabad