float to int in c code example
Example 1: c float to int
# you can cast in c like so
float my_float= 1.446;
int my_int = (int) my_float;
Example 2: int to float c
float percentage;
percentage = (float)number/total * 100;
# you can cast in c like so
float my_float= 1.446;
int my_int = (int) my_float;
float percentage;
percentage = (float)number/total * 100;