Answers for "cast to float c"

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
0

int to float c

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

Code answers related to "C"

Browse Popular Code Answers by Language