Skip to content

vansharmaweb/PRACTICE-GPT

Repository files navigation

C Programming Practice Repository

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.

📂 Folder Structure

LOOPS/ (10 Questions)

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

PATTERNS/ (7 Questions)

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

FUNCTIONS/ (6 Questions)

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

RECURSIONS/ (3 Questions)

Recursive problem-solving:

  • Factorial using recursion
  • Fibonacci using recursion
  • Other recursive algorithms

Files: ques_31.c through ques_33.c

POINTERS/ (6 Questions)

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

ARRAYS/ (7 Questions)

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

STRINGS/ (12 Questions)

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

STRUCTURES/ (10 Questions)

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 HANDLING/ (7 Questions)

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 & Searching/ (10 Questions)

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

F H files/

Sample data files used for file handling exercises:

  • abc.txt, copy.txt, emp.txt, new.txt

📋 Main Reference

questions.txt - Contains descriptions and question numbers for all exercises across different topics.

🎯 How to Use

  1. Select a Topic: Choose a folder based on the C concept you want to practice
  2. Open the File: Navigate to the specific question (e.g., ques_1.c)
  3. Understand the Problem: Read the code comments explaining what the program should do
  4. Compile and Run:
    gcc filename.c -o filename
    ./filename
  5. Practice: Modify the code, add enhancements, or solve variations

📊 Question Distribution

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

🚀 Learning Path Recommendation

Beginner:

  1. Start with LOOPS to understand control flow
  2. Move to PATTERNS for practical output manipulation
  3. 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

💡 Tips for Practice

  • 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

🔧 Compilation

General compilation command:

gcc program_name.c -o program_name
./program_name

For programs with multiple files or dependencies, adjust the command accordingly.


Happy Coding! 🎓

About

Got Questions from ChatGPT and solved them. There are a lot of cool question problems in this repo.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors