Home / CSE MCQs / C#.Net MCQs :: Discussion

Discussion :: C#.Net MCQs

  1. Scope of variable is related to definition of variable as:

    1. Region of code within which variable value is valid and hence can be accessed.
    2. No, relation with region where variable is declared its value is valid in entire scope.
  2. A.
    a
    B.
    b
    C.
    a, b
    D.
    None of the mentioned

    View Answer

    Workspace

    Answer : Option A

    Explanation :

    Scope of variable is the area or region within which variable is declared and hence intialized values of different kind. Based, on which operations of different kinds are carried out on that variable declared within that scope. Its value is preserved until and unless scope of that block ({ })is not expired because as soon as scope gets over. Hence, variable value gets expired. Hence, it's inaccessible after it.


Be The First To Comment