first commit!
This commit is contained in:
18
fahrenheittable.c
Normal file
18
fahrenheittable.c
Normal file
@ -0,0 +1,18 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int main() {
|
||||
double fahr, celcius;
|
||||
double lower, upper, step;
|
||||
|
||||
lower = 0;
|
||||
upper = 300;
|
||||
step = 20;
|
||||
|
||||
fahr = lower;
|
||||
printf("%6c %8c\n", 'F', 'C');
|
||||
while (fahr <= upper) {
|
||||
celcius = 5.0/9 * (fahr - 32);
|
||||
printf("%6.2f %8.2f\n", fahr, celcius);
|
||||
fahr = fahr + step;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user