The UNIX and Linux Forums
>
Top Forums
>
High Level Programming
how do I calculate percentage ?
.
User Name
Remember Me?
Password
google unix.com
Forums
Register
Forum Rules
Links
Albums
FAQ
Members List
Calendar
Search
Today's Posts
Mark Forums Read
Thread
:
how do I calculate percentage ?
View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
#
1
(
permalink
)
04-18-2007
the_learner
Registered User
Join Date: Apr 2007
Posts: 75
how do I calculate percentage ?
int percent (int a, int b)
{
if (b/a*100 > 25)
return TRUE;
else
return FALSE;
}
I want to calculate what percentage of a is b.
say if b = 48, a = 100
so b is 48% of a
but wouldnt b/a give me 0 ??? what can be done ??
the_learner
View Public Profile
Find all posts by the_learner
Find the_learner's past nominations received
Find the_learner's present nominations given