HOME HTML EDITOR C JAVA PHP

C Exercises: Level Up Your Coding

The best way to master C is through practice. Below are exercises categorized by difficulty. Try to solve them without looking at previous notes first!

Level 1: Beginner (Syntax & Logic)

Focus on basic loops, conditionals, and stdio.h.

[Image of Fibonacci sequence logic flowchart]

Level 2: Intermediate (Arrays & Strings)

Focus on data manipulation and the string.h and ctype.h libraries.

Level 3: Advanced (Math & Memory)

Focus on math.h, stdlib.h, and complex logic.

Level 4: Real-World Challenge

The Task: Create a "Mini ATM System".
1. It should have a fixed PIN.
2. Allow the user 3 attempts to login (using ctype.h for validation).
3. Features: Check Balance, Deposit Money, and Withdraw Money.
4. Use time.h to print a receipt with the current date and time.

Technical Self-Check

If you struggle with... Review this module:
Loop logic or Prime numbers C Reference / Basic Syntax
String comparisons or Vowels C String / C ctype.h
Memory errors or malloc C stdlib.h
Pro Tip: Don't just write the code—Debug it! Use the printf() debugging method we discussed earlier to trace your variables at every step of the loop.