Home | Community | Message Board


This site includes paid links. Please support our sponsors.


Welcome to the Shroomery Message Board! You are experiencing a small sample of what the site has to offer. Please login or register to post messages and view our exclusive members-only content. You'll gain access to additional forums, file attachments, board customizations, encrypted private messages, and much more!

Jump to first unread post Pages: 1
InvisibleChe_Night_Soil
Koinoniphobic

Registered: 07/16/02
Posts: 1,533
Loc: Commonslaughtia
Simple C Program Help Needed
    #2287681 - 01/30/04 05:00 PM (20 years, 28 days ago)

If anyone is bored enough to cut/paste this and help it would be greatly appreciated. I have the rule of 72, but I don't know what formula to use for the actual. I guess I just need the formula. Thanks in advance.
-Che

#include
#include
main()
{
float years;
float rate;
float unrounded;
int rounded;

printf("\t\t\tRule of 72\n\n");
printf("Years until prices double due to listed interest ");
printf("rates (inflation):\n\n");
printf("Interest\tRule\nRate(%c)\t\tof72\t\tActual\n\n", 37);

for (rate=1; rate<=20; rate++)
{years=72/rate;

unrounded=years;
rounded=years;

if (unrounded-rounded>0)
{years=rounded+1;
}

printf("%.0f\t\t%.0f\n", rate, years);
}
printf("\n");

return 0;
}

The highest # in the actual column is a 70, so whatever test that checks for doubling has to run 70x.


--------------------
if(human==autoPart){
for(i=1;i<infinity;i++){
getBorn(mind,soul);
getEdu(mind,soul);
getJob(mind,soul);
retire(mind,soul);
die(mind,soul);
}
}


Extras: Filter Print Post Top
InvisibleChe_Night_Soil
Koinoniphobic

Registered: 07/16/02
Posts: 1,533
Loc: Commonslaughtia
Re: Simple C Program Help Needed [Re: Che_Night_Soil]
    #2287961 - 01/30/04 07:03 PM (20 years, 28 days ago)

How about how to test for a variable being doubled in a loop?


--------------------
if(human==autoPart){
for(i=1;i<infinity;i++){
getBorn(mind,soul);
getEdu(mind,soul);
getJob(mind,soul);
retire(mind,soul);
die(mind,soul);
}
}


Extras: Filter Print Post Top
Jump to top Pages: 1


Similar ThreadsPosterViewsRepliesLast post
* I need a way to hide folders Chemical_Smile 2,581 19 08/16/02 04:53 PM
by tps
* Programming books or tutorials? Anonymous 1,270 8 06/12/03 01:09 PM
by Anonymous
* I need help building a PC Rainbow 1,334 8 05/21/09 07:50 AM
by dopelogic
* What can i program for you?
( 1 2 all )
vaporbrains 3,017 22 05/03/03 04:33 AM
by dumlovesyou
* Need a Keystroke Recorder Lana 1,838 19 02/17/03 04:45 PM
by Pure
* Looking for a program. Pinhead 1,028 7 08/30/03 09:14 PM
by bivalve
* moving programs/folders teardrop 1,070 4 11/12/02 11:12 AM
by JovialLeprechaun
* Need FAST HD encryption advice earlyriser 2,667 8 06/06/01 07:07 AM
by Anno

Extra information
You cannot start new topics / You cannot reply to topics
HTML is disabled / BBCode is enabled
Moderator: trendal, automan, Northerner
615 topic views. 0 members, 1 guests and 2 web crawlers are browsing this forum.
[ Show Images Only | Sort by Score | Print Topic ]
Search this thread:

Copyright 1997-2024 Mind Media. Some rights reserved.

Generated in 0.022 seconds spending 0.007 seconds on 14 queries.