The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > High Level Programming
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #7 (permalink)  
Old 04-18-2007
tantric tantric is offline
Registered User
  
 

Join Date: Apr 2007
Posts: 23
since a and b are int b/a will return 0.
So, b/a * 100 will return 0. But since f is float, f will be 0.0

I think this works:

f = ((float)b * 100)/a