Home »
MCQs »
C# MCQs
Which is the correct C# statement to convert a float value to int explicitly?
28. Which is the correct C# statement to convert a float value to int explicitly?
- int_variable = (int) float_variable;
- int_variable = float_variable;
- int_variable = (int) (float_variable);
- int_variable = int *float_variable);
Answer: A) int_variable = (int) float_variable;
Explanation:
The following syntax is used to convert a float value to int explicitly:
int_variable = (int) float_variable;