I'm rather new : the message board section should probably explain that to anyone reading. I don't have a lot of experience with computers, matter of fact, I'm buying my first computer some time soon (currently using one that belongs to another family member). But in any case.
I'm testing a few things in C, in a compiler called "Miracle C", and there seems to be a problem with something I've done in an experimental program. I don't know what, else I'd fix it myself and go on my way, so I figured I'd post the short script here and see if anyone can help me pick up the error.
Also, I'm not entirely sure what the definite use of "short", "long", and "int", are. All numerical values, obviously, but why use one over the other..?
Anyways, here is the script, as it were.
/* stocks : testing constant, and floating */#include
const float Revenue_per_150 = 4.5f;
short JanSold = 23500;
short FebSold = 19300;
short MarSold = 21600;
float RevQuarter = 0.0f;
short QuarterSold = JanSold + FebSold + MarSold;
/* output monthly sales and total for quarter */
Stock sold in
JanSold, FebSold, MarSold);
Total stock sold in first quarter: %d",
/* calc. total rev. for quarter & output it */
RevQuarter = QuarterSold/150*Revenue_Per_150;
Sales revenue this quarter is: $%.2f