100% Free Forever
AI-Powered Learning
Industry Expert Content
Certificates & Badges
Learn At Your Own Pace
C

Introduction to C Programming

Learn what C programming is, why it matters, and how its simple syntax and low-level power make it the foundation of modern computing.

Introduction to CBeginner8 min readJul 7, 2026
Analogies

1. Introduction

C is a general-purpose, procedural programming language created in the early 1970s at Bell Labs. It gives programmers direct control over memory and hardware while still offering structured, readable syntax, which is why it is often described as a 'middle-level' language — it bridges the gap between low-level assembly and high-level languages.

🏏

Cricket analogy: C is like the classic straight bat technique from 1970s cricket, foundational and disciplined, that still underlies modern power-hitting styles used by players like Rohit Sharma, giving direct control over the shot rather than relying on flashy improvisation.

C is compiled, statically typed, and case-sensitive. It underpins operating systems (Linux, Windows kernel components), embedded systems, database engines, and countless other languages (C++, Java, Python, and JavaScript engines all borrow syntax or are implemented in C). Learning C builds a strong mental model of how memory, pointers, and the compilation process actually work.

🏏

Cricket analogy: Just as the straight drive underpins shots played by everyone from Sunil Gavaskar to Virat Kohli, C underpins operating systems, embedded systems, and languages like C++, Java, and Python, making it the technique every later style borrows from.

2. Syntax

c
#include <stdio.h>

int main(void) {
    printf("Hello, World!\n");
    return 0;
}

3. Explanation

Every C program must have exactly one main() function, which is the entry point where execution begins. The #include <stdio.h> directive tells the preprocessor to insert the Standard Input/Output library header, which declares printf() and other I/O functions. The statement inside main() ends with a semicolon, and return 0; signals successful termination to the operating system.

🏏

Cricket analogy: Every cricket match must have exactly one toss to decide who bats first, the true entry point of the game; similarly every C program has exactly one main() function, and #include <stdio.h> is like bringing the official scorebook (printf) onto the field before play begins, with return 0; signaling a completed, valid match.

C programs are compiled, not interpreted: source code (.c files) is translated by a compiler (like gcc or clang) into machine code before it runs, which makes C programs fast and portable across platforms with a compatible compiler.

Exam tip: C requires explicit declaration of variable types and does not have built-in support for object-oriented concepts like classes — it is purely procedural, organizing code into functions that operate on data.

🏏

Cricket analogy: Just as a scorer must explicitly record whether a delivery is a wide, no-ball, or legal ball rather than leaving it ambiguous, C requires explicit declaration of every variable's type; and just as cricket has no 'classes' of players, only individual roles executing specific tasks, C is purely procedural with functions operating on data.

4. Example

c
#include <stdio.h>

int main(void) {
    int age = 21;
    float height = 5.9f;
    char grade = 'A';

    printf("Age: %d\n", age);
    printf("Height: %.1f ft\n", height);
    printf("Grade: %c\n", grade);

    return 0;
}

5. Output

text
Age: 21
Height: 5.9 ft
Grade: A

6. Key Takeaways

  • C is a compiled, procedural, statically-typed general-purpose language created in the 1970s.
  • Execution always begins at the main() function.
  • Header files like stdio.h are included via preprocessor directives to access library functions.
  • Every statement ends with a semicolon; the language is case-sensitive.
  • C's low-level memory access and speed make it the foundation for operating systems and many other languages.
  • return 0; from main() conventionally signals successful program termination.

Practice what you learned

Was this page helpful?

Topics covered

#CProgrammingStudyNotes#Programming#IntroductionToCProgramming#Syntax#Explanation#Example#Output#StudyNotes#SkillVeris#ExamPrep