Skip to content

Gutheras/All-about-C-Structured-Programming

Repository files navigation

C Programming Basics Repository

Welcome to the C Programming Basics repository! This collection contains simple and essential C programs for beginners and intermediate learners who want to understand the fundamentals of C programming. Each file in this repository demonstrates a specific concept, from basic syntax to control structures.

-Table of Contents - About - Contents - Getting Started - How to Use - Examples - Contributing

About

This repository contains foundational programs in C, covering fundamental topics such as loops, conditional statements and logical operations. Each program is designed to illustrate a single concept clearly and concisely, making it easier for beginners to learn by example. If you're just getting started with C programming, this repository provides a great resource for hands-on practice and understanding basic program structure, syntax and control flows in C.

Contents

File Description
Arithmetic.c Basic arithmetic operations
Logical.c Demonstration of logical operators
Relational.c Examples of relational operators
If.c Simple if statement usage
IfElse.c Demonstrates if-else control structure
IfElseIfElse.c Nested if-else with multiple conditions
NestedIf.c Example of nested if statements
Switch.c Usage of switch statement
NestedSwitch.c Nested switch example
While.c Simple while loop
DoWhile.c Usage of do-while loop
For.c Example of for loop
Hello.c A simple "Hello, World!" program

Getting Started

-To run these programs, you will need:

  • A C compiler (such as gcc) installed on your system.
  • A code editor or IDE that supports C (e.g., VS Code, Code::Blocks, or Dev-C++). -Compiling and Running i.Clone this repository to your local machine: git clone https://github.com/Gutheras/All-about-C-Structured-Programming ii.Navigate to the directory: cd your-repository iii.Compile and run any .c file using a C compiler. For example: gcc Hello.c -o Hello ./Hello

How to Use

Each file is a standalone example of a specific concept or feature in C. Simply open the file you are interested in, review the code, and run it in your environment. Modify and experiment with the code to deepen your understanding.

Examples

Here are a few examples of the concepts covered:

Arithmetic Operations:

// Arithmetic.c int a = 10, b = 5; printf("Sum: %d\n", a + b);

Conditional Statements:

// IfElse.c int number = 10; if (number > 0) { printf("Positive number\n"); } else { printf("Negative number\n"); }

Loops:

// For.c for (int i = 0; i < 5; i++) { printf("i = %d\n", i); } These are just a few examples. Explore each file to see more

Contributing

If you'd like to contribute to this repository, please fork the repository, make your changes and submit a pull request. Contributions such as additional examples, bug fixes and optimizations are welcome!

Happy coding! If you find this repository helpful please consider giving it a ⭐️.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages