You are returning a pointer to a local variable. The percentage variable exists only in the calculatePercentage function. As soon as the function exits, that variable goes out of scope (dies)... meaning the pointer you are returning instantly becomes a bad pointer.
You should not be using pointers at all for this. Instead, just have calculatePercentage return a normal float... and make your percent variable in main a normal float instead of a pointer.