Initial commit for KNR C exercises

This commit is contained in:
Reina Harrington-Affine 2025-07-29 13:06:28 -07:00
commit 67483eaceb
4 changed files with 32 additions and 0 deletions

BIN
KNR C/a.out Executable file

Binary file not shown.

View file

@ -0,0 +1,25 @@
#include <stdio.h>
/* print farenheit-celsius table
* for fahr = 0, 20, ..., 300 */
int main()
{
float fahr, celsius;
float lower, upper, step;
lower = 0; /* lower bound of temp scale*/
upper = 300; /* upper bound of temp scale*/
step = 20; /* step size between calculated conversions*/
fahr = lower;
while (fahr <= upper)
{
celsius = (5.0/9.0) * (fahr-32);
printf("%3.0f\t%6.1f\n", fahr, celsius);
fahr = fahr + step;
}
return 0;
}

7
KNR C/hello_world.c Normal file
View file

@ -0,0 +1,7 @@
#include <stdio.h>
int main()
{
printf("hello, world\n");
return 0;
}

BIN
KNR C/hello_world.out Executable file

Binary file not shown.