Memory Allocation - Programming

Q1:

Which of the following statement is correct prototype of the malloc() function in c ?

A int* malloc(int);

B char* malloc(char);

C unsigned int* malloc(unsigned int);

D void* malloc(size_t);

ANS:A - int* malloc(int);

size_t is the size of memory needed to be allocated. Void is the default return type for malloc.
Once malloc allocates memory, it either returns the pointer of allocated address or returns null if fails.

Generally void returns no return type. Still there is no problem. As automatic type conversions are possible for void type. Thus it can return pointer sometimes.