This repository contains a collection of exercises designed to help students learn and practice important computer science concepts. The exercises are written in C and cover a variety of topics, including loops, strings and arrays, functions and recursion, pointers and structures, and file handling.
To complete the exercises in this repository, you will need the following tools:
- A C compiler (such as GCC)
- A text editor (such as Visual Studio Code or Sublime Text)
To compile and run the exercises, follow these steps:
- Open a terminal or command prompt.
- Navigate to the directory where the exercise files are located.
- Compile the exercise using the
gcc
command. For example, to compileexercise1.c
, you would use the commandgcc exercise1.c -o exercise1
. - Run the compiled exercise using the
./
command. For example, to runexercise1
, you would use the command./exercise1
.
You can use the make
command to automatically compile all of the programs in this repository. To do this, you will need to have the make
utility installed on your system.
To use make
, open a terminal or command prompt and navigate to the directory where the Makefile
is located. Then, simply run the make
command. This will compile all of the programs in the repository and create executables in the build folder in the root of the repository. The programs in the build folder are divided into folders based on the exercise they belong to.
Alternatively, you can compile each program individually using the gcc
command, as described in the "Setup" section above.
You can find the Makefile
for this repository here.
-
Exercise 1: Loops - This exercise covers the use of loops to iterate over collections of data.
-
Exercise 2: Strings and Arrays - This exercise covers the use of strings and arrays to store and manipulate data.
-
Exercise 3: Functions and Recursion - This exercise covers the use of functions and recursion to break down complex tasks into smaller, more manageable pieces.
-
Exercise 4: Pointers and Structures - This exercise covers the use of pointers and structures to manage complex data structures.
-
Exercise 5: File Handling - This exercise covers the use of file handling functions to read and write data from and to files.
All content in this repository is licensed under the MIT License. See the LICENSE file for more information.