Home | Community | Message Board


Avalon Magic Plants
Please support our sponsors.

General Interest >> Science and Technology

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 07:00 PM (12 years, 10 months 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);
}
}


Post Extras: Print Post  Remind Me! Notify Moderator
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 09:03 PM (12 years, 10 months 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);
}
}


Post Extras: Print Post  Remind Me! Notify Moderator
Jump to top. Pages: 1

General Interest >> Science and Technology

Similar ThreadsPosterViewsRepliesLast post
* my simple programming questions thread (javascript + html) stefan 543 3 04/28/08 06:43 PM
by stefan
* Program needed - for drawing electronic circuit diagrams DieCommie 952 3 02/10/07 07:06 PM
by Seuss
* My first program evar YthanA 658 4 07/08/08 10:16 AM
by Newbie
* Program for editing movies T0aD 647 5 01/20/04 02:41 AM
by nife
* laptop for school... need a little help
( 1 2 all )
t00th 1,565 23 12/16/08 07:06 PM
by supra
* Program design help SeussA 1,293 8 05/04/07 11:11 AM
by phi1618
* I need a way to hide folders Chemical_Smile 1,902 19 08/16/02 06:53 PM
by tps
* Statistics time: Programming Languages and Programmers
( 1 2 all )
delta9 3,193 26 05/16/07 02:17 PM
by SymmetryGroup8

Extra information
You cannot start new topics / You cannot reply to topics
HTML is disabled / BBCode is enabled
Moderator: Lana, trendal, Diploid, automan
517 topic views. 0 members, 2 guests and 2 web crawlers are browsing this forum.
[ Toggle Favorite | Print Topic | Stats ]
Search this thread:
Myco Supply
Please support our sponsors.

Copyright 1997-2016 Mind Media. Some rights reserved.

Generated in 0.028 seconds spending 0.003 seconds on 14 queries.