What is the scope of a global variable in C#?
A. Limited to the block in which it is declared
B. Limited to the method in which it is declared
C. Limited to the class in which it is declared
D. Throughout the entire program
Answer: Option D
A. Limited to the block in which it is declared
B. Limited to the method in which it is declared
C. Limited to the class in which it is declared
D. Throughout the entire program
Answer: Option D
What is the correct syntax to declare a variable in C#?
A. variable int num;
B. num = int;
C. int = num;
D. int num;
Which of the following is NOT a valid variable name in C#?
A. 1variable
B. _variable
C. variable1
D. Variable
Join The Discussion