The UNIX and Linux Forums  

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



High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
How can I get a processor's CPU Percentage? sangjinn High Level Programming 3 10-09-2008 09:28 AM
how to get the percentage of completion? during a copy! wrapster UNIX for Advanced & Expert Users 7 05-24-2008 02:55 AM
how to make percentage of a running script? jimmbp Shell Programming and Scripting 1 01-31-2006 02:41 PM
Computung Percentage preetikate UNIX for Dummies Questions & Answers 2 02-09-2004 10:13 AM
percentage sign in a drive mapping ? simon2000 UNIX for Advanced & Expert Users 2 09-17-2002 01:30 PM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 04-18-2007
the_learner the_learner is offline
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 ??
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 09:23 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0