Updated readme. Going through first chapter
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
/*
|
||||
* Simple hello world application
|
||||
*
|
||||
* Author: Kun Deng
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
printf("hello, world\n");
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user