Answers for "c int to float"

C#
5

convert string to float c

char myString = "6.88";
float x = atof(myString);
//x is now 6.88
Posted by: Guest on February-20-2020
6

how to convert float to int c#

float someFloat = 42.7f;
int someInt = (int)someFloat;               // 42
Posted by: Guest on July-01-2020
1

int to float c

float percentage;
percentage = (float)number/total * 100;
Posted by: Guest on November-25-2020
-2

c float to int

# you can cast in c like so
float my_float= 1.446;
int my_int = (int) my_float;
Posted by: Guest on May-29-2020

C# Answers by Framework

Browse Popular Code Answers by Language