I'm reading the K&R book and doing the exercises. Currently, I'm working
on Exercise 1-3.
Here's what I have:
Now, this completes the exercise. Technically, anyway. However, I want
to make the "F" and "C" align properly above the right side of their
respective columns.
I realize this is probably a really minor thing, but I'd appreciate the
help none-the-less!
- Gio
--
AND NOW FOR A WORD (an IF blog):
on Exercise 1-3.
Here's what I have:
Code:
#include <stdio.h>
main()
{
float fahr, celsius;
float lower, upper, step;
lower = 0; /* lower limit of temperatuire scale */
upper = 300; /* upper limit */
step = 20; /* step size */
fahr = lower;
printf("F\t\tC\n");
while (fahr <= upper) {
celsius = (5.0/9.0) * (fahr-32.0);
printf("%4.0f %7.1f\n", fahr, celsius);
fahr = fahr + step;
}
}
to make the "F" and "C" align properly above the right side of their
respective columns.
I realize this is probably a really minor thing, but I'd appreciate the
help none-the-less!
- Gio
--
AND NOW FOR A WORD (an IF blog):
Comment