C Programming Basics
An Interactive Introduction for
Students
Introduction to C
• • Developed by Dennis Ritchie in 1972 at Bell
Labs
• • General-purpose, procedural programming
language
• • Foundation for many modern languages (C+
+, Java, etc.)
Why Learn C?
• • Simple and powerful language
• • Closer to hardware (system programming)
• • Widely used in embedded systems
• • Basis of Operating Systems, Compilers, etc.
Structure of a C Program
• #include <stdio.h>
• int main() {
• printf("Hello, World!\n");
• return 0;
• }
C Program Execution Steps
• 1. Writing the code (source code)
• 2. Compilation (check errors)
• 3. Linking libraries
• 4. Execution (run the program)
Basic Syntax
• • Case-sensitive
• • Statements end with semicolon (;)
• • Main function is the entry point
• • Curly braces { } define blocks
Data Types in C
• • int → Integer (e.g., 10, -5)
• • float → Decimal numbers (e.g., 3.14)
• • char → Single character ('A')
• • double → Higher precision decimal
Control Structures
• • if, if-else, nested if
• • switch-case
• • for loop, while loop, do-while loop
• • break, continue
Flowchart Example - if-else
• Start → Condition → Yes → Statement1 → End
• → No → Statement2 → End
Applications of C
• • Operating Systems (Linux, Windows parts)
• • Embedded Systems
• • Game Development
• • Database Systems (MySQL)
• • Compilers & Interpreters
Conclusion
• C is a powerful foundation language that helps
in understanding:
• • Memory management
• • Efficient coding
• • System-level programming
• It is the gateway to advanced programming
languages.