This repo contains all codes in C that are not a part of competitive programming like CSES that I do for better understanding.
c-random is a collection of C programs written for learning, experimentation, and better understanding of programming concepts. Unlike competitive programming solutions, these programs focus on exploring C language fundamentals, algorithms, and problem-solving techniques in a practice-oriented environment.
The repository contains individual C files, each demonstrating a specific concept or solving a particular problem:
1toN.c: Program to print numbers from 1 to N
// Demonstrates basic loops and iterationGrades.c: Grade calculation or classification program
// Implements conditional logic for grade assignmentfrequency.c: Character or element frequency counter
// Counts occurrences of elements in arrays or stringsprimeValidator.c: Prime number validation program
// Checks if a given number is primerev.C: String or number reversal program
// Reverses the order of characters or digitsstrstr.c: String search implementation
// Finds substring within a larger string- Learning Exercises: Programs written to understand C concepts
- Algorithm Practice: Implementations of common algorithms
- Problem Solving: Solutions to programming challenges outside competitive platforms
- Concept Exploration: Experiments with C language features and libraries
The code samples demonstrate:
- Loops and iteration (for, while, do-while)
- Conditional statements (if-else, switch)
- Arrays and strings manipulation
- Functions and modular programming
- Input/output operations
- Mathematical computations
- String processing algorithms
- C Fundamentals: Variables, data types, operators, and control structures
- Memory Management: Pointers, arrays, and dynamic allocation
- Algorithm Design: Efficient solutions to common problems
- Standard Library: Using stdio.h, string.h, and other standard headers
- Problem Decomposition: Breaking problems into manageable functions
- Clone the repository:
git clone https://github.com/achille010/c-random.git
cd c-random- Compile a program:
gcc -o 1toN 1toN.c- Run the executable:
./1toN- Or compile with warnings enabled:
gcc -Wall -o primeValidator primeValidator.c# Compile and run
gcc -o 1toN 1toN.c
./1toN
# Input: 10
# Output: 1 2 3 4 5 6 7 8 9 10# Compile and run
gcc -o primeValidator primeValidator.c
./primeValidator
# Input: 17
# Output: 17 is a prime number# Compile and run
gcc -o rev rev.C
./rev
# Input: hello
# Output: olleh- Programs are for learning and practice purposes
- Not optimized for production use
- May lack comprehensive error handling
- Compiled executables (.exe) are included (typically not best practice for repos)
- Code focuses on concept demonstration over code optimization
This is intentionally a collection of practice and learning exercises in C.
- C compiler (gcc, clang, or MSVC)
- Basic understanding of C programming
- Terminal or command prompt
Contributions are welcome! Feel free to fork this repository and submit pull requests for improvements.
MIT License - Read details from the LICENSE file
Built as a collection of C practice programs for learning and understanding