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;