Introduction to C Programming

C is a powerful general-purpose, procedural computer programming language created by Dennis Ritchie in 1972. It forms the backbone of operating systems, embedded systems, compilers, and high-performance engines.

Why Learn C?

Hardware-Level Control

Direct memory access via pointers gives you full control over CPU registers, memory layout, and system architecture.

Blazing Fast Speed

Compiled directly to machine code with zero runtime overhead or garbage collection pauses, making it ultra-efficient.

Foundation of Modern Tech

Linux, Windows kernels, Git, Python's CPython runtime, and MySQL are all fundamentally engineered in C.

First C Program

Every executable C program requires a main() function, which acts as the entry point for the operating system.

Standard Hello World (hello.c):
hello.c
1#include <stdio.h> 2 3int main(void) { 4 // printf prints formatted text to stdout 5 printf("Hello, World! Welcome to C Programming.\n"); 6 7 // Return 0 indicates successful execution to OS 8 return 0; 9}

Compiling & Running

Use the GCC (GNU Compiler Collection) or Clang to compile `.c` source files into an executable binary.

GCC Commands:
terminal
1# Compile source code into an executable 2gcc -Wall -O2 hello.c -o hello 3 4# Run the compiled binary 5./hello