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
+9 -1
View File
@@ -1,2 +1,10 @@
# Info
A collection of examples, exercises, and experience while learning the C programming language. The source material used to learn C is from *The C Programming Language 2nd Edition by Dennis Ritchie and Brian Kerningham*. The reason I chose this book is due to numerous amounts of programmers acknowledging this as a well put book explaining the language. The book is concise and achieves the objectives of exhibiting how the language can be used and inspiring to further advancement. Though C is a small language this book serves as a good read to get acquainted with C. There aren't vast examples or tirades delving into painstakingly detailed concepts. It's a good introductory book. I get a good grasp of the language. Even more, I get to learn C as C. Instead of falling into the trap when learning a new language without getting used to it. I know C++ but C shouldn't be viewed as C++ without all of the extra stuff. After all, C++ was originally meant to be a subset of C but never did.
A collection of examples, exercises, and experiments while learning the C programming language
## Resources and tools used
* Book - **The C Programming Language 2nd Edition** *by Dennis Ritchie and Brian Kerningham*
* Compiler - GCC >= 8
* Linux OS
The source material used to learn C is from *The C Programming Language 2nd Edition by Dennis Ritchie and Brian Kerningham*. The reason I chose this book is due to numerous programmers acknowledging this as a well put together book explaining the language. The book is concise and achieves the objective of exhibiting how the language can be used and inspires further advancement. Though C is a small language this book serves as a good read to get acquainted. There aren't vast examples or tirades delving into painstakingly detailed concepts. It's a good introductory book. Even more, I get to learn C as C. Instead of falling into the trap when learning a new language without getting used to it. I know C++ but C shouldn't be viewed as C++ without all of the extra stuff. After all, C++ was originally meant to be a subset of C but never did.
+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;
}