A comprehensive collection of C programming practice problems organized by topic. This repository contains daily practice exercises designed to build fundamental and advanced C programming skills.
Fundamental loop-based problems covering:
- Printing sequences (1 to 100)
- Sum of natural numbers
- Even/odd number filtering
- Factorial calculation
- Number reversal
- Palindrome checking
- Multiplication tables
- Prime number generation
- Fibonacci series
Files: ques_1.c through ques_10.c
Pattern printing exercises:
- Hollow pyramids
- Number pyramids
- Special number patterns
- Diamond patterns
- Pascal's triangle
- Floyd's triangle
- Butterfly patterns
- Prime and Fibonacci patterns
Files: ques_11.c through ques_17.c
Function definition and calling practice:
- Sum of two numbers
- Factorial calculation
- Prime checking
- Circle area calculation
- Number reversal
- Greatest of three numbers
- Palindrome checking
- Digit counting
- Sum of digits
- Even/odd determination
- Temperature conversion (Celsius to Fahrenheit)
- Power calculation
- Number swapping (by value)
- Number swapping (by reference)
- Pattern printing using functions
Files: ques_21.c through ques_26.c
Recursive problem-solving:
- Factorial using recursion
- Fibonacci using recursion
- Other recursive algorithms
Files: ques_31.c through ques_33.c
Pointer manipulation and memory management:
- Pointer basics
- Pointer arithmetic
- Function pointers
- Call by reference
- Array pointers
- Dynamic memory allocation
Files: ques_41.c through ques_46.c
Array operations and 2D arrays:
- Array traversal
- Finding maximum/minimum
- Array searching
- 2D array operations
- Matrix manipulation
Files: 2D_array.c, ques_51.c through ques_57.c
String manipulation and operations:
- String input/output
- String length
- String concatenation
- String comparison
- String reversal
- Character counting
- Substring operations
- String searching
Files: ques_81.c through ques_92.c
Struct definition and usage:
- Employee records
- Student information
- Data organization
- Nested structures
- Arrays of structures
- Pointers to structures
Files: ques_101.c through ques_106.c, ques_1011.c, ques_1012.c, ques_1013.c
File I/O operations:
- Reading from files
- Writing to files
- File manipulation
- File operations with structures
Files: ques_107.c, ques_f01.c through ques_f106.c
Sorting and searching algorithms:
- Binary search (
bin.c) - Linear search (
search_1.c,search_2.c) - Bubble sort (
sort_1.c) - Other sorting algorithms (
sort_2.c) - Array reversal (
reverse.c,reverseRecurse.c) - Recursive solutions (
divisibleSumPairs.c) - Smart checking (
checksmart.c)
Files: Various algorithm implementations
Sample data files used for file handling exercises:
abc.txt,copy.txt,emp.txt,new.txt
questions.txt - Contains descriptions and question numbers for all exercises across different topics.
- Select a Topic: Choose a folder based on the C concept you want to practice
- Open the File: Navigate to the specific question (e.g.,
ques_1.c) - Understand the Problem: Read the code comments explaining what the program should do
- Compile and Run:
gcc filename.c -o filename ./filename
- Practice: Modify the code, add enhancements, or solve variations
| Topic | Count | Focus |
|---|---|---|
| Loops | 10 | Fundamental iteration |
| Patterns | 7 | Pattern printing |
| Functions | 6 | Function design |
| Recursions | 3 | Recursive thinking |
| Pointers | 6 | Memory management |
| Arrays | 7 | Data structures |
| Strings | 12 | String operations |
| Structures | 10 | Complex data types |
| File Handling | 7 | I/O operations |
| Sorting & Searching | 10 | Algorithms |
| Total | 78 | Comprehensive Practice |
Beginner:
- Start with LOOPS to understand control flow
- Move to PATTERNS for practical output manipulation
- Learn FUNCTIONS for code organization
Intermediate: 4. Master ARRAYS for data structure basics 5. Study STRINGS for text manipulation 6. Practice POINTERS for memory concepts
Advanced: 7. Explore RECURSIONS for algorithmic thinking 8. Work with STRUCTURES for data organization 9. Learn FILE HANDLING for I/O operations 10. Implement SORTING & SEARCHING for algorithm optimization
- Start simple, gradually increase difficulty
- Try to solve problems without looking at solutions first
- Understand the "why" behind each solution
- Modify code and experiment with different approaches
- Test with multiple input cases
- Write code comments to explain logic
General compilation command:
gcc program_name.c -o program_name
./program_nameFor programs with multiple files or dependencies, adjust the command accordingly.
Happy Coding! 🎓