|
1 | 1 | # C Language Programs
|
2 | 2 |
|
3 |
| -This folder contains beginner-friendly C programs that demonstrate core concepts, written as part of my course practice. |
| 3 | +This folder contains step-by-step C programs, starting from the basics and moving toward intermediate concepts. |
| 4 | +Each file is numbered for easy navigation, so learners can follow the sequence like a tutorial series. |
4 | 5 |
|
5 |
| -## File List |
| 6 | +--- |
| 7 | + |
| 8 | +## 📂 Program List |
6 | 9 |
|
7 | 10 | 1. **01_hello_world.c**
|
8 |
| - - Prints "Hello, World!" to the screen. |
9 |
| - - First step into C programming. |
| 11 | + Prints `"Hello, World!"` to the screen. The first program for every C learner. |
10 | 12 |
|
11 | 13 | 2. **02_variables.c**
|
12 |
| - - Demonstrates declaring variables and printing their values. |
13 |
| - - Example: integers, floats, characters. |
| 14 | + Shows how to declare variables (`int`, `float`, `char`) and print their values using `printf()`. |
| 15 | + |
| 16 | +3. **03_data_types.c** |
| 17 | + Demonstrates different data types in C (int, float, double, char) and their storage sizes. |
| 18 | + |
| 19 | +4. **04_constants.c** |
| 20 | + Introduction to constants (`const` keyword) and why immutability matters. |
| 21 | + |
| 22 | +5. **05_operators.c** |
| 23 | + Examples of arithmetic, assignment, comparison, and logical operators. |
| 24 | + |
| 25 | +6. **06_booleans.c** |
| 26 | + Demonstrates boolean logic in C using `_Bool` or `<stdbool.h>`. |
| 27 | + |
| 28 | +7. **07_if_else_loops.c** |
| 29 | + Decision making with `if`, `else if`, and `else`. |
| 30 | + |
| 31 | +8. **08_while_loops.c** |
| 32 | + Shows the use of `while` loops for repeated execution based on conditions. |
14 | 33 |
|
15 |
| -3. **03_conditions.c** |
16 |
| - - Shows how to use `if`, `else`, and comparison operators. |
| 34 | +9. **09_for_loops.c** |
| 35 | + Demonstrates `for` loops with counters and iterations. |
17 | 36 |
|
18 |
| -4. **04_loops.c** |
19 |
| - - Examples of `for`, `while`, and `do-while` loops. |
| 37 | +10. **10_arrays.c** |
| 38 | + Introduction to arrays: declaring, initializing, and accessing elements. |
| 39 | + |
| 40 | +11. **11_user_input.c** |
| 41 | + Using `scanf()` to take input from the user. |
| 42 | + |
| 43 | +12. **12_switches.c** |
| 44 | + Control flow using the `switch` statement. |
20 | 45 |
|
21 | 46 | ---
|
22 | 47 |
|
| 48 | +## ⚡ How to Compile & Run |
| 49 | + |
| 50 | +Using **GCC**: |
| 51 | +```bash |
| 52 | +gcc 01_hello_world.c -o hello |
| 53 | +./hello |
| 54 | + |
| 55 | + |
23 | 56 | ## How to Compile & Run
|
24 | 57 | Using GCC:
|
25 | 58 | ```bash
|
|
0 commit comments