Updated readme. Going through first chapter

This commit is contained in:
kdeng00
2020-08-31 21:59:22 -04:00
parent 2e01b9afc3
commit 0d53df1c65
4 changed files with 62 additions and 1 deletions
+14
View File
@@ -0,0 +1,14 @@
/*
* Simple hello world application
*
* Author: Kun Deng
*/
#include <stdio.h>
int main()
{
printf("hello, world\n");
return 0;
}
+16
View File
@@ -0,0 +1,16 @@
/*
* Another way to print a new line
*
* Author: Kun Deng
*/
#include <stdio.h>
int main()
{
char new_line = 0x0A;
printf("hello, world%c", new_line);
return 0;
}
+23
View File
@@ -0,0 +1,23 @@
/*
* Converts temperatures from fehrenheit to celsius starting from 0 to 200. Incrementing by 10
*
* Author: Kun Deng
*/
#include <stdio.h>
#define UPPER 200
#define LOWER 0
#define STEP 10
int main(int argc, char **argv)
{
printf("%13s %13s\n", "fahrenheit", "celsius");
for (double fahrenheit = LOWER; fahrenheit <= UPPER; fahrenheit = fahrenheit + STEP)
{
printf("%13.2f %13.2f\n", fahrenheit, ((fahrenheit - 32) * 5.0 / 9.0));
}
return 0;
}