A collection of simple C programs to get you started with coding. Best for Students and self-learners.
This repository's 43 beginner-friendly programs are its main feature. Each one is a step toward becoming proficient in C.
Click to expand the full list of programs
# | Program | Key Concepts | Difficulty |
---|---|---|---|
1 | BMI Calculator | User Input , Math Ops , Conditionals |
🟢 Easy |
2 | Power of a Number | Loops , Exponentiation |
🟢 Easy |
3 | Armstrong Number Checker | Digit Math , Loops , Conditionals |
🟡 Medium |
4 | Strong Number Checker | Factorials , Digit Operations |
🟡 Medium |
5 | Leap Year Checker | Conditionals , Logical Ops |
🟢 Easy |
6 | Palindrome Number Check | Reversing Numbers , Loops |
🟢 Easy |
7 | Perfect Number Checker | Divisibility , Looping |
🟡 Medium |
8 | Binary to Decimal Conversion | Loops , Base Conversion |
🟡 Medium |
9 | Factorial Calculator | Recursion , Iteration |
🟡 Medium |
10 | Fibonacci Series Generator | Recursion , Loops |
🟡 Medium |
11 | Floyd's Triangle | Pattern Generation , Loops |
🟢 Easy |
12 | HCF (GCD) of Two Numbers | Euclidean Algorithm , Math Ops |
🟡 Medium |
13 | Reverse a Number | Digit Manipulation , Loops |
🟢 Easy |
14 | Temperature Converter | Arithmetic , Input/Output |
🟢 Easy |
15 | Reverse Array Elements | Arrays , Index Manipulation |
🟡 Medium |
16 | Check for Repeated Digits | Arrays , Frequency Tracking |
🟡 Medium |
17 | Sum of Digits | Loops , Digit Extraction |
🟢 Easy |
18 | Sum of Even & Odd Digits | Digit Extraction , Conditionals |
🟢 Easy |
19 | Count Number of Digits | Loops , Integer Division |
🟢 Easy |
20 | Greatest of Three Numbers | Conditionals , Comparisons |
🟢 Easy |
21 | Check Char Type | ASCII , Conditionals |
🟢 Easy |
22 | Vowel or Consonant Checker | Conditionals , Characters |
🟢 Easy |
23 | Simple Calculator | Switch Case , Arithmetic Ops |
🟢 Easy |
24 | Swap Numbers (Temp Var) | Variables , Logic |
🟢 Easy |
25 | Swap Numbers (No Temp Var) | Arithmetic , Logic |
🟢 Easy |
26 | Prime Number Checker | Loops , Conditionals |
🟡 Medium |
27 | Primes in a Range | Nested Loops , Optimization |
🟡 Medium |
28 | Number to Words (0-999) | Conditionals , String Mapping |
🟡 Medium |
29 | Simple Interest Calculator | Input/Output , Math Ops |
🟢 Easy |
30 | Compound Interest Calculator | Math Library , Loops |
🟡 Medium |
31 | LCM of Two Numbers | Math Ops , HCF Logic |
🟡 Medium |
32 | Decimal to Binary | Loops , Base Conversion |
🟡 Medium |
33 | Multiplication Table | Loops , Formatting |
🟢 Easy |
34 | Armstrong in a Range | Loops , Number Theory |
🟡 Medium |
35 | Find ASCII Value | ASCII , Data Types |
🟢 Easy |
36 | Display ASCII Table | Loops , Characters |
🟢 Easy |
37 | Bubble Sort | Sorting , Arrays , Nested Loops |
🟡 Medium |
38 | Linear Search | Arrays , Search Logic |
🟢 Easy |
39 | Binary Search | Binary Search , Sorted Arrays |
🟡 Medium |
40 | Find Max in Array | Arrays , Loops , Comparison |
🟢 Easy |
41 | Find Min in Array | Arrays , Loops , Comparison |
🟢 Easy |
42 | Sum of Array Elements | Arrays , Loops , Accumulation |
🟢 Easy |
43 | Sum of N Natural Numbers | Loops , Accumulation |
🟢 Easy |
This project uses a Makefile
to simplify compilation. You no longer need to run gcc
manually for each file.
-
Clone the Repo:
git clone https://github.com/TheTimelessRecall/C-Odyssey.git cd C-Odyssey
-
Compile the Code: You can compile all programs at once or just a specific one.
- Compile all programs:
make all
- Compile a single program (e.g.,
bmi_cal.c
):make bin/bmi_cal
All compiled programs will be placed in a
bin/
directory. - Compile all programs:
-
Run an Executable:
./bin/bmi_cal
-
Clean Up (Optional): To remove all compiled files, run:
make clean
Check out these great resources to keep going on your journey.
Expand for learning resources
📁 C-Odyssey/
├── 📁 .github/workflows/
│ └── 📄 c-build.yml
├── 📁 programs/
│ ├── 📄 bmi_cal.c
│ └── ... (42 more files)
├── 📄 LICENSE
├── 📄 Makefile
└── 📄 README.md
Contributions are welcome. If you have a beginner-friendly C program to add, please fork the repo and submit a pull request.
This project is licensed under the MIT License. See the LICENSE file for more details.