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?

  1. int_variable = (int) float_variable;
  2. int_variable = float_variable;
  3. int_variable = (int) (float_variable);
  4. 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;

Comments and Discussions!

Load comments ↻






Copyright © 2024 www.includehelp.com. All rights reserved.