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. What is use of \r in c

  • used to insert a vertical tab
  • used to insert a tab
  • places cursor at the end of line
  • places cursor at the start of line

2. Which is invalid name of identifier

  • world
  • addition23
  • test_name
  • factorial

3. What will be output of
#include
void main()
{
char test =`S`;
printf("\n%c",test);
}

  • S
  • Error
  • Garbage value
  • None of above

4. What is correct order of precedence in C

  • Addition, Division, Modulus
  • Addition, Modulus, Division
  • Multiplication, Substration, Modulus
  • Modulus, Multiplication, Substration

5. Wild pointer in C

  • if pointer is pointing to a memory location from where variable has been deleted
  • if pointer has not been initialized
  • if pointer has not defined properly
  • if pointer pointing to more than one variable
Read more from - C Programming Questions Answers - Chapter 1
Post a comment