Sail E0 Webinar

MCQs

Total Questions : 86 | Page 9 of 9 pages
Question 81. What is the problem in the following declarations?     int func(int);     double func(int);     int func(float);
  1.    A function with same name cannot have different signatures
  2.    A function with same name cannot have different return types
  3.    A function with same name cannot have different number of parameters
  4.    All of the mentioned
 Discuss Question
Answer: Option D. -> All of the mentioned


None.


Question 82. What is the output of code given below?    enum m{JAN, FEB, MAR};    enum m foo();    int main()    {        enum m i = foo();        printf("%d\n", i);    }    int  foo()    {        return JAN;    }
  1.    Compile time error
  2.    0
  3.    Depends on the compiler
  4.    Depends on the standard
 Discuss Question
Answer: Option A. -> Compile time error


None.


Question 83. What is the output of this C code?    int x = 5;    void main()    {        int x = 3;        printf("%d", x);        {            int x = 4;        }        printf("%d", x);    }
  1.    3  3
  2.    3  4
  3.    3  5
  4.    Run time error
 Discuss Question
Answer: Option A. -> 3  3


None.


Question 84. What is the output of this C code?   int x = 5;    void main()    {        int x = 3;        printf("%d", x);        {            x = 4;        }        printf("%d", x);    }
  1.    Run time error
  2.    3  3
  3.    3  5
  4.    3  4
 Discuss Question
Answer: Option D. -> 3  4


None.


Question 85. What is the output of this C code?

    int x;    void main()    {        printf("%d", x);    }

  1.    Junk value
  2.    Run time error
  3.    0
  4.    Undefined
 Discuss Question
Answer: Option C. -> 0


None.


Question 86. What is the output of this C code?    void main()    {        m();        printf("%d", x);    }    int x;    void m()

    {        x = 4;    }

  1.    4
  2.    Compile time error
  3.    0
  4.    Undefined
 Discuss Question
Answer: Option B. -> Compile time error


None.


Latest Videos

Latest Test Papers