Sail E0 Webinar

MCQs

Total Questions : 86 | Page 8 of 9 pages
Question 71. Assignment statements assigning value to local static variables are executed only once?
  1.    true
  2.    false
  3.    Depends on the code
  4.    None of the mentioned
 Discuss Question
Answer: Option B. -> false


None.


Question 72. What is the output of this C code?
void m()
{
printf("hi");
}
void main()
{
m();
}
  1.    hi
  2.    Run time error
  3.    Nothing
  4.    Varies
 Discuss Question
Answer: Option A. -> hi


None.


Question 73. What is the output of this C code?    void main()    {        m();    }    void m()    {        printf("hi");        m();    }

  1.    Compile time error
  2.    hi
  3.    Infinite hi
  4.    Nothing
 Discuss Question
Answer: Option C. -> Infinite hi


None.


Question 74. What is the output of this C code?
void m();
void n()
{
m();
}
void main()
{
void m()
{
printf("hi");
}
}
  1.    hi
  2.    Compile time error
  3.    Nothing
  4.    Varies
 Discuss Question
Answer: Option B. -> Compile time error


None.


Question 75. What is the output of this C code?    void main()    {        m();        void m()        {            printf("hi");        }    }
  1.    hi
  2.    Compile time error
  3.    Nothing
  4.    Varies
 Discuss Question
Answer: Option B. -> Compile time error


None.


Question 76. What is the output of this C code?    void main()    {        static int x = 3;        x++;        if (x
  1.    Run time error
  2.    hi
  3.    infinite hi
  4.    hi  hi
 Discuss Question
Answer: Option D. -> hi  hi


None.


Question 77. What is the return-type of the function sqrt()
  1.    int
  2.    float
  3.    double
  4.    Depends on the data type of the parameter
 Discuss Question
Answer: Option C. -> double


None.


Question 78. What is the output of this code having void return-type function?     void foo()    {        return 1;

    }

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

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


None.


Question 79. What will be the data type returned for the following function?    int func()    {        return (double)(char)5.0;    }
  1.    char
  2.    int
  3.    double
  4.    multiple type-casting in return is illegal
 Discuss Question
Answer: Option B. -> int


None.


Question 80. Which of the following function declaration is illegal?
  1.    double func();     int main(){}     double func(){}
  2.    double func(){};     int main(){}
  3.    int main()     {     double func();     }double func(){//statements}
  4.    None of the mentioned
 Discuss Question
Answer: Option D. -> None of the mentioned


None.


Latest Videos

Latest Test Papers