Sail E0 Webinar

MCQs

Total Questions : 86 | Page 4 of 9 pages
Question 31. What is the default return type if it is not specified in function definition?
  1.    void
  2.    int
  3.    double
  4.    short int
 Discuss Question
Answer: Option B. -> int


None.


Question 32. functions can return enumeration constants in c?
  1.    true
  2.    false
  3.    depends on the compiler
  4.    depends on the standard
 Discuss Question
Answer: Option A. -> true


None.


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

    int foo();    int main()    {        int i = foo();    }    foo()    {        printf("2 ");        return 2;    }

  1.    2
  2.    Compile time error
  3.    Depends on the compiler
  4.    Depends on the standard
 Discuss Question
Answer: Option A. -> 2


None.


Question 34. functions can return structure in c?
  1.    true
  2.    false
  3.    Depends on the compiler
  4.    Depends on the standard
 Discuss Question
Answer: Option A. -> true


None.


Question 35.

What is the output of this C code?    double foo();    int main()    {        foo();        return 0;    }    foo()    {        printf("2 ");        return 2;    }

  1.    2
  2.    Compile time error
  3.    Depends on the compiler
  4.    Depends on the standard
 Discuss Question
Answer: Option B. -> Compile time error


None.


Question 36. Is initialization mandatory for local static variables?
  1.    YES
  2.    NO
  3.    Depends on the compiler
  4.    Depends on the standard
 Discuss Question
Answer: Option B. -> NO


None.


Question 37. Functions in C are ALWAYS:
  1.    Internal
  2.    External
  3.    Both Internal and External
  4.    External and Internal are not valid terms for functions
 Discuss Question
Answer: Option B. -> External


None


Question 38. Global variables are:
  1.    Internal
  2.    External
  3.    Both (a) and (b)
  4.    None of the mentioned.
 Discuss Question
Answer: Option B. -> External


None.


Question 39.

Which of the following are an external variable?    int func (int a)    {        int b;        return b;    }    int main()    {        int c;        func (c);    }    int d;

  1.    a
  2.    b
  3.    c
  4.    d
 Discuss Question
Answer: Option D. -> d


None.


Question 40. What will be the output?    double var = 8;    int main()    {        int var = 5;        printf("%d", var);    }
  1.    5
  2.    8
  3.    Compile time error due to wrong format identifier for double
  4.    Compile time error due to redeclaration of variable with same name
 Discuss Question
Answer: Option A. -> 5


None.


Latest Videos

Latest Test Papers