download Mastguru Android App

Question Detail

Difference between calloc() and malloc()

  • calloc() takes a single argument while malloc() needs two arguments
  • malloc() takes a single argument while calloc() needs two arguments
  • malloc() initializes the allocated memory to ZERO
  • calloc() initializes the allocated memory to NULL
Similar Questions :

1. printf() belongs to which library of c

  • stdlib.h
  • stdio.h
  • stdout.h
  • stdoutput.h

2. Out of following program :
float x = 10.7;
int i;

i = (int) x;
print i;

  • null
  • error
  • 10
  • garbage value

3. What will be the output of following program
#include
main()
{
int x,y = 10;
x = y * NULL;
printf(\"%d\",x);
}

  • error
  • 0
  • 10
  • Garbage value

4. Which operator in c can't be overloaded

  • %
  • +
  • ::
  • -

5. If include files can be nested

  • Yes
  • No
Read more from - C Programming Questions Answers - Chapter 1
Post a comment