this repository contains few files of my journey learning C.
This repository is a collection of C programming examples, organized into individual folders for each important concept. Whether you are a beginner or looking to reinforce your understanding, this repository can serve as a helpful reference.
Welcome to the C Programming Concepts repository! Here, you will find code examples and explanations for various fundamental concepts in the C programming language. The organized structure of the repository makes it easy to explore and learn at your own pace.
The project follows a structured organization, with each concept having its own dedicated folder. This makes it easy to navigate and focus on specific topics without getting overwhelmed.
- Variables: Understanding and using variables in C.
- Operators: Exploring different operators in C.
- Switch Statement: Implementing the switch statement.
- If...Else Statement: Using conditional statements in C.
- Data Types: Overview of various data types in C.
- Comments: Writing effective comments in C.
To run the C programs from the command line (CMD), follow these steps:
- Open a command prompt.
- Navigate to the directory containing the concept you want to run:
cd path/to/concept_folder
- Compile the C file using a C compiler (e.g., GCC):
gcc program_name.c -o program_name
- Run the compiled program:
./program_name
If you prefer using a simple text editor like Notepad to write and edit C code, follow these steps:
- Open Notepad.
- Copy the code from the concept folder's
.c
file. - Save the file with a
.c
extension (e.g.,program_name.c
). - Open a command prompt and navigate to the directory containing the saved
.c
file. - Compile and run the program using the steps mentioned in the "Running Programs" section.
Feel free to choose your preferred text editor or IDE for writing and running C programs.
Variables are containers for storing data values. In C, variables must be declared with a specific data type, and they can be used to store different types of information.
Operators in C are symbols that perform operations on variables and values. Examples include arithmetic operators (+, -, *, /) and relational operators (==, !=, <, >).
The switch statement is used to evaluate a variable or expression against multiple possible values. It provides an efficient way to handle multiple conditions.
The if...else statement allows for conditional execution of code. It enables the program to make decisions based on whether a given condition is true or false.
C supports various data types, including int, float, double, char, and more. Understanding data types is essential for effective variable declaration and usage.
Comments in C are used to explain the code and make it more readable. They are ignored by the compiler and are solely for the benefit of the programmer.
If you find an issue, have a suggestion, or want to add more concepts, contributions are welcome! Follow these steps:
- Fork the repository.
- Create a new branch:
git checkout -b feature/new-concept
. - Commit your changes:
git commit -am 'Add a new concept'
. - Push the branch:
git push origin feature/new-concept
. - Submit a pull request.
This project is licensed under the MIT License.