Bill, could you persuade your news reader to quote correctly?
You also snip very heavily.
news:6d5ef1e2-6f98-441c-a1c9-661a8c7925ab@m44g2000hsc.googlegroups.com....
Nick Keighley here:
I know nothing about the financial world (which I'm guessing
from previous posts is your application domain) so this
might as well be a series of random numbers.
What is your input and how is input derived from output?
In pseudo code you want somthing like this
LOOP UNTIL finished
read input
calc value
print output
END LOOP
To be honest from your code at the beginning of the thread
and your sample output I can deduce what you are trying to do.
I could write the program for you. But I don't think that would help
you. One skill that is essential to programming is the ability
to express yourself clearly. You don't have it. If you can't
explain what you want to do how can you expect to write a program
to do it?
In your original code did you notice that you performed a calculation
using x BEFORE YOU HAD READ A VALUE INTO x?
You need to call strtod() BEFORE you calculate y.
Bill: from here
Nick The above looks exactly like what I want but I really don't think
I've gotten that far. I am working to create a mean of numbers.
what numbers? Do you read them from a file? You can't calculate a mean
without a loop!
double mean (double a[], int n)
{
double sum;
for (i = 0; i < n; i++)
sum += a
;
return sum / n;
}
So is y supposed to be the sum in your program?
Yes. Yes. Exactly, z is supposed to be the actual average of the y
divided by count. I have been thinking while loops and perhaps all this time
I've been needing for loops. Maybe nested for loops.