prepending a number to examples to keep them in order

This commit is contained in:
2024-05-01 14:59:57 -06:00
parent 3dac05767b
commit 58c1b78744
2 changed files with 0 additions and 0 deletions

View File

@ -0,0 +1,2 @@
all:
gcc -o temperature-table.x86_64 main.c

View File

@ -0,0 +1,18 @@
#include <stdio.h>
#define LOWER 0 /* lower limit of table */
#define UPPER 300 /* upper limit of table */
#define STEP 20 /* increment size */
int main()
{
float fahr, celsius, tModifier;
fahr = LOWER;
tModifier = (5.0/9.0);
while (fahr <= UPPER) {
celsius = tModifier * (fahr - 32.0);
printf("%3.0f°F\t%5.1f°C\n", fahr, celsius);
fahr = fahr + STEP;
}
}