This repository contains a collection of entry-level C programming examples designed for beginners. The files are organized in a logical learning order, covering everything from basic syntax to functions and arrays.
- 01_hello_world.c: Basic syntax, printing to console (
printf). - 02_variables_and_types.c: Data types (
int,float,char) andtypedef. - 03_arithmetic_operators.c: Input (
scanf), arithmetic operations, and calculating averages.
- 04_if_else_basics.c: Basic
if-elselogic (Positive/Negative check). - 05_logical_operators.c: Using
&&(AND) and||(OR) operators. - 06_char_checker.c: Working with characters and vowel checking.
- 07_nested_if_grades.c: Complex decision trees using
else ifladders. - 08_switch_case.c: Building menus with
switch-case.
- 09_loops_intro.c: Introduction to
whilevsforloops. - 10_loop_accumulator.c: Summing numbers with loops (Accumulator pattern).
- 11_multiplication_table.c: Practical loop usage (Multiplication table).
- 12_break_continue.c: Controlling loop flow with
breakandcontinue.
- 13_arrays_intro.c: Declaring arrays and accessing elements.
- 14_functions_void.c: Creating functions that do not return a value.
- 15_functions_return.c: Functions with parameters and return values.
- 16_random_generator.c: Generating random numbers using
time.handstdlib.h.
You can compile these files using any standard C compiler (like GCC).
Example for GCC:
gcc 01_hello_world.c -o program
./program