Welcome to my collection of C programming practice files. These files demonstrate various C programming concepts and techniques that I've learned throughout my coursework. Each file is a standalone program that focuses on a specific topic or problem.
This repository contains practice C programs that I developed during my college coursework. The files cover a wide range of C programming topics such as:
- Basic Syntax and Data Types
- Control Flow (loops, conditionals)
- Functions
- Arrays and Pointers
- Strings
- File I/O
- Dynamic Memory Allocation
- Structures and Unions
Each file is well-documented with comments explaining the logic behind the code.
Below is a list of the key programs in this repository:
| Filename | Description |
|---|---|
hello_world.c |
Basic program to print "Hello, World!" |
calculator.c |
Simple calculator performing addition, subtraction, etc. |
factorial.c |
Program to calculate the factorial of a given number |
array_sort.c |
Sorting an array of integers using the bubble sort algorithm |
pointer_demo.c |
Demonstrates the use of pointers in C |
file_io.c |
Reading from and writing to a file |
dynamic_memory.c |
Example of dynamic memory allocation with malloc() |
struct_example.c |
Demonstrates the use of structures in C |
Feel free to browse the individual files for more information on each program.
You can compile and run any of these C programs using a C compiler such as gcc. Below are the steps to compile and execute a program:
-
Compiling a Program: Open your terminal and navigate to the folder containing the C file you want to compile. Use the following command to compile:
gcc filename.c -o output_name
Example for
hello_world.c:gcc hello_world.c -o hello_world
-
Running the Program: After compilation, you can run the program using:
./output_name
Example:
./hello_world
Here are some additional resources that helped me in learning C programming:
Feel free to explore these resources to deepen your understanding of C.
This repository is for educational purposes, but if you have suggestions or improvements, feel free to fork the repo and submit a pull request.
Thank you for visiting this repository! Happy coding! 🚀