Function in C MCQs Exercise I


Ques 1 Function


A function declaration tells about the _______
  a) function's name
  b) return type
  c) parameters
  d) All of these


d is the correct option





Ques 2 Function


Which of the following is not a Library function?
  a) string( )
  b) strrev( )
  c) strcat( )
  d) None of these


d is the correct option





Ques 3 Function


Consider the following C function

int f(int n)
{
    static int r=0;
    if(n<=0) return 1;
    if(n>3)
    {
        r=n;
        return f(n-2)+2;
    }
    return f(n-1)+r;
}

What is the value of f(5)?

  a) 5
  b) 7
  c) 9
  d) 18


d is the correct option





Ques 4 Function


The execution of a C Program starts with the?
  a) user define function
  b) main function
  c) void function
  d) All of these


b is the correct option