Select a convenient declaration and initialization of a floating point number:
A. float somevariable = 12.502D
B. float somevariable = (Double) 12.502D
C. float somevariable = (float) 12.502D
D. float somevariable = (Decimal)12.502D
Answer: Option C
A. float somevariable = 12.502D
B. float somevariable = (Double) 12.502D
C. float somevariable = (float) 12.502D
D. float somevariable = (Decimal)12.502D
Answer: Option C
What is the correct syntax to declare a variable in C#?
A. num = int;
B. var num;
C. num int;
D. int num;
What is the purpose of the 'var' keyword in C#?
A. Declares a constant
B. Converts a variable to string
C. Implicitly declares a variable
D. Defines a method
Join The Discussion