1
0
mirror of https://github.com/krislamo/knrc.git synced 2024-09-19 21:00:35 +00:00

Exercise 1-4. print Celsius to Fahrenheit table

This commit is contained in:
Kris Lamoureux 2021-11-03 23:53:07 -04:00
parent c9506f8dcb
commit 93126a8207
Signed by: kris
GPG Key ID: 3EDA9C3441EDA925
2 changed files with 15 additions and 1 deletions

View File

@ -0,0 +1,11 @@
#include <stdio.h>
/* print Celsius-Fahrenheit table */
int main()
{
int cels;
printf("Celsius\t\tFahrenheit\n==========================\n");
for (cels = 0; cels <= 300; cels = cels + 20)
printf("%3d\t\t%10.0f\n", cels, (9.0/5.0)*cels+32);
}

View File

@ -1,4 +1,4 @@
all: hello mathvars
all: hello mathvars c2f
hello: 01-hello-world.c
gcc -o ./bin/01-helloworld 01-hello-world.c
@ -6,5 +6,8 @@ hello: 01-hello-world.c
mathvars: 02-vars-and-math.c
gcc -o ./bin/02-mathvars 02-vars-and-math.c
c2f: 03-celsius-to-fahrenheit.c
gcc -o ./bin/03-c2f 03-celsius-to-fahrenheit.c
clean:
$(RM) ./bin/*-*