Sail E0 Webinar

MCQs

Total Questions : 13 | Page 2 of 2 pages
Question 11. Which is false ?
  1.    A variable defined once can be defined again with different scope
  2.    A single variable cannot be defined with two different types in the same scope
  3.    A variable must be declared and defined at the same time
  4.    A variable refers to a location in memory
 Discuss Question
Answer: Option C. -> A variable must be declared and defined at the same time


It is not an error if the variable is declared and not defined. For example “ extern declarations.


Question 12. A variable declared in a function can be used in main?
  1.    True
  2.    False
  3.    True if it is declared static
  4.    None of the mentioned.
 Discuss Question
Answer: Option B. -> False


Since the scope of the variable declared within a function is restricted only within that function,
the above statement is false.


Question 13. The name of the variable used in one function cannot be used in another function?
  1.    True
  2.    False
  3.    May be
  4.    None of the mentioned.
 Discuss Question
Answer: Option B. -> False


Since the scope of the variable declared within a function is restricted only within that function, the same name can be used to declare another variable in another function.


Latest Videos

Latest Test Papers