Learn To Solve It¶
This is a companion website to learn C programming using K&R book. It uses modern tools, and is designed to be used along with the book.
I recommend https://exercism.org as the platform to learn Programming and practice with a dedicated community.
Reference Books
C Programming Language by Kernighan and Ritchie.
C Programming¶
- A Tutorial Introduction
- 1.1 Getting Started
- 1.1 testing hello, world
- 1.2 Variables and Arithmetic Expressions
- 1.3 The for statement
- 1.3 Temperature Convertor
- 1.4 Symbolic Constants
- 1.4 Temperature Convertor
- 1.5.1 File Copying
- 1.5.2 Character Counting
- 1.5.2 Character Counting2
- 1.5.3 Line Counting
- 1.5.4 Word Counting
- 1.5 Character Input and Output
- 1.5 Temperature Convertor in Reverse
- 1.6 Arrays
- 1.6 Verify the value of EOF
- 1.7 Functions
- 1.7 Value of EOF
- 1.8 Count blanks, tabs and newlines
- 1.9 Character Arrays
- 1.9 Replace Continous blanks with a single blank
- 1.10 External Variables and Scope
- 1.10 Explicit Tabs, Backslash and Backspaces
- 1.11 Test Word count program
- 1.13.2 Vertical Histogram
- 1.13 Horizontal Histogram
- 1.14 Histogram of Frequency of Characters
- 1.15 Temperature Convertor using function call
- 1.16 Print length of arbitrary long input line
- 1.17 Print lines that are longer than 80 chars
- 1.18 Remove trailing blanks and tabs
- 1.19 reverse a string
- 1.20 detab, replaces tabs with spaces
- 1.21 entab, replaces spaces with tabs
- 1.22 fold long lines
- 1.23 Remove comments from a C program
- 1.24 Check rudimentary Syntax Errors in a C Program
- Types, Operators and Expressions
- 2.1 Count the Ranges
- 2.2 Write getline without && and || operator
- 2.3 Converting Hexadecimal Digits Into Integers
- 2.4 Compare S1, S2 To Delete Same Character in S1
- 2.5 return the first location in the string s1 comparing s2
- 2.6 Setting bits at a position n
- 2.7 Setting bits at a position n Inverted
- 2.8 returns the value of the integer x rotated to the right by n positions
- 2.9 two’s complement number system
- 2.10 upper case letters to lower case
- Control Flow
- Functions and Program Structure
- 4.1 strindex which returns rightmost occurance
- 4.2 Extend atof to handle scientific notation
- 4.3 RPN modulus operator and negative numbers
- 4.4 RPN Calculator - print two top elements of the stack without popping
- 4.5 RPN Calculator with mathematical functions
- 4.6 RPN Calculator with variables
- 4.7 Function ungets that will push back an entire string onto the input
- 4.8 getch and ungetch handling pushback character
- 4.9 getch and ungetch handling EOF Character
- 4.10 Calculator using getline
- 4.11 getline using static
- 4.12 convert integer into string by calling recursive routine
- 4.13 reverse the string s
- 4.14 swap that interchanges two arguments of type t
- Pointers and Arrays
- 5.1 get next integer from input to *pn
- 5.2 get next float from input to *pn
- 5.3 strcat(s,t) copies the string t to the end of s
- 5.4 strend returns 1 if string t occurs at the end of the string s
- 5.5 simple versions of strncpy, strncat, and strncmp
- 5.6 Find the pattern using pointers
- 5.7 Readlines using array
- 5.8 program which has day of the year and month day
- 5.10 expr, evaluate rpn from command line
- 5.11 entab and detab which accepts arguments
- 5.12 entab -m + which accepts arguments
- 5.13 tail prints the last n lines of input
- 5.14 sorting in reverse (decreasing) order
- 5.15 fold upper and lower case together
- 5.16 -d makes comparison on letters, numbers, blanks
- 5.17 Sorting with options
- 5.18 recover from input errors
- 5.19 undcl does not add redundant parentheses
- 5.20 dcl handling declarations with function argument types, qualifiers
- Structures
- Input and Output
- 7.1 upper case to lower or lower case to upper
- 7.2 print non-graphic characters in octal or hexadecimal
- 7.3 minprintf to handle facilities of printf
- 7.4 private version of scanf
- 7.5 Postfix calculator using scanf
- 7.6 Compare Two files
- 7.7 Pattern matching program with files
- 7.8 Print Pages to Files
- 7.9 Analyze implementations of isupper
- The UNIX System Interface
- 8.1 program cat using read, write, open and close
- 8.2 Rewrite fopen and _fillbuf with fields
- 8.3 _flushbuf, fflush and fclose
- 8.4 implement fseek
- 8.5 inode entry
- 8.6 Write calloc, by calling malloc
- 8.7 Error checking by malloc
- 8.8 bfree maintained by malloc
- 8.2 Buffered and Unbuffered getchar
- 8.2 Read and Write
- 8.3 open and create calls
- C Programming Building Blocks
- C Concepts Visualization
- Stack Frames and Local Variables
- Pointer as a Memory Address
- Array and Pointer Arithmetic
- String as a Null-Terminated Character Array
- Pass by Value vs Pass by Reference
- Linked List and Heap Allocation
- Recursive Call Stack Unwinding
- Stack Data Structure: sp Index and val[] Array
- Struct Memory Layout and Nested Structs
- Union: Multiple Interpretations of the Same Bytes
- Static Variable: Persistent Local State
- Pointer to Pointer: Two Levels of Indirection
