• ( 1 ) What is the output of this C code?
      void main()
      {
      static int x;
      printf("x is %d", x);
      }

    • 1) 0
    • 2) 1
    • 3) Junk value
    • 4) Run time error
    • Discussion in forum
      Answer : 1) 0
      Solution :








      discussion


      Answer : 1) 0

    • ( 2 ) The declaration void function1(int) indicates the function1 is a function which

    • 1) Has no arguments
    • 2) Returns nothing
    • 3) Both 1 & 2
    • 4) None of these
    • Discussion in forum
      Answer : 2) Returns nothing
      Solution :








      discussion


      Answer : 2) Returns nothing

    • ( 3 ) The output of the code below is
      #include
      void main()
      {
      int k = m();
      printf("%d", k);
      }
      void m()
      {
      printf("hello");
      }

    • 1) hello 5
    • 2) Erro
    • 3) Nothing
    • 4) Junk value
    • Discussion in forum
      Answer : 1) hello 5
      Solution :








      discussion


      Answer : 1) hello 5

    • ( 4 ) The function is lower(char) checks whether a character is in lower case or not, therefore it should return

    • 1) 0 or 1
    • 2) -1,0 or 1
    • 3) nothing
    • 4) a character
    • Discussion in forum
      Answer : 1) 0 or 1
      Solution :








      discussion


      Answer : 1) 0 or 1

    • ( 5 ) How to declare an array of N pointers to functions returning pointers to functions returning pointers to characters?

    • 1) Char *(*(*a[N])))
    • 2) Char (*(*(*a[N])))
    • 3) Char (*(*a[N]))
    • 4) None of these
    • Discussion in forum
      Answer : 1) Char *(*(*a[N])))
      Solution :








      discussion


      Answer : 1) Char *(*(*a[N])))

    • ( 6 ) Function vprintf() uses the functionality of which header file?

    • 1) Stadgs.h
    • 2) Stdarg.h
    • 3) Stdio.h
    • 4) None of these
    • Discussion in forum
      Answer : 2) Stdarg.h
      Solution :








      discussion


      Answer : 2) Stdarg.h

    • ( 7 ) When a function is recursively called, all automatic variables

    • 1) Are initialized during each execution of the function
    • 2) Are retained from the last execution
    • 3) Are maintained in a queue
    • 4) None of these
    • Discussion in forum
      Answer : 1) Are initialized during each execution of the function
      Solution :








      discussion


      Answer : 1) Are initialized during each execution of the function

    • ( 8 ) What does the error, invalid redeclaration of a function mean?

    • 1) There is no declaration in scope,
    • 2) There are multiple declarations
    • 3) Function is invalid
    • 4) None of these
    • Discussion in forum
      Answer : 1) There is no declaration in scope,
      Solution :








      discussion


      Answer : 1) There is no declaration in scope,

    • ( 9 ) Which of the following is true for static variable?

    • 1) It can be called from another function.
    • 2) It exists even after the function ends.
    • 3) It can be modified in another function by sending it as a parameter.
    • 4) All of the above
    • Discussion in forum
      Answer : 2) It exists even after the function ends.
      Solution :








      discussion


      Answer : 2) It exists even after the function ends.

    • ( 10 ) Consider the function
      find ( int x, int y)
      {
      return (( x < y ) ? 0 : ( x - y ));
      }
      Let a, b be two non-negative integers.
      The call find{ a, find(a, b)} can be used to find the

    • 1) maximum of a, b
    • 2) positive difference of a, b
    • 3) sum of a, b
    • 4) minimum of a, b
    • Discussion in forum
      Answer : 4) minimum of a, b
      Solution :








      discussion


      Answer : 4) minimum of a, b





Top