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
#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
#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
Age: 21
Height: 5.9 ft
Grade: A6. 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
1. Which function serves as the entry point of every C program?
2. C is best classified as a:
3. Which header file is required to use printf() and scanf()?
4. What does 'C is case-sensitive' mean?
5. Which paradigm does standard C primarily follow?
Was this page helpful?
You May Also Like
History and Evolution of C
Trace C's evolution from Dennis Ritchie's 1972 creation at Bell Labs through K&R C, ANSI C, and modern C99/C11 standards.
Features of C
Explore the core features of C — portability, speed, modularity, pointers, and rich operators — that make it a systems programming staple.
Structure of a C Program
Understand the standard structure of a C program — headers, main function, declarations, statements, and comments — with a worked example.
Related Reading
Related Study Notes in Programming
Browse all study notesApache Spark Study Notes
Programming · 30 topics
ProgrammingApache Flink Study Notes
Programming · 30 topics
ProgrammingHadoop Study Notes
Programming · 30 topics
ProgrammingSnowflake Study Notes
Programming · 30 topics
ProgrammingApache Airflow Study Notes
Programming · 30 topics
Programmingdbt (Data Build Tool) Study Notes
Programming · 30 topics