Introduction to C Programming
• A Foundational Language for Systems
Programming
• Your Name
• Department Name, University Name
• Date
Learning Objectives
• - Understand the history and features of C
• - Write, compile, and execute a simple C
program
• - Explain C syntax, variables, and data types
• - Explore control structures, functions, and
arrays
Why Learn C?
• - Foundation of many modern languages (C++,
Java, etc.)
• - High performance, close to hardware
• - Widely used in systems, embedded, and OS
programming
• - ANSI standard language
History of C
• - Developed by Dennis Ritchie at Bell Labs
(1972)
• - Evolved from B language
• - UNIX OS written in C
• - ANSI standardized in 1989
Structure of a C Program
• #include <stdio.h>
• int main() {
• printf("Hello, World!");
• return 0;
• }
Compilation Process
• 1. Write code (.c file)
• 2. Compile using GCC or similar
• 3. Link libraries
• 4. Execute .exe or binary
Variables and Data Types
• - Data Types: int, float, char, double
• - Declaration Example:
• int age = 25;
• char grade = 'A';
Operators in C
• - Arithmetic: +, -, *, /, %
• - Relational: ==, !=, <, >
• - Logical: &&, ||, !
• - Assignment: =, +=, -=
Control Statements
• - if-else
• - switch-case
• - loops: for, while, do-while
• Example:
• for(int i = 0; i < 5; i++) {
• printf("%d ", i);
• }
Functions in C
• - Reusable blocks of code
• - Syntax:
• int add(int a, int b) {
• return a + b;
• }
• - main() is also a function
Arrays
• - Collection of same data type
• - Syntax:
• int arr[5] = {1, 2, 3, 4, 5};
• - Access with index: arr[0]
Pointers (Intro Only)
• - Holds memory address of another variable
• - Syntax:
• int x = 5;
• int *p = &x;
C vs Other Languages
• Feature | C | Python | Java
• --------|---|--------|-----
• Speed | High | Medium | Medium
• Memory Mgmt | Manual | Automatic |
Automatic
• Use Cases | OS, Drivers | Scripting | Enterprise
Demo / Code Example
• - Walkthrough of live code (basic calculator or
menu-driven app)
• - Use VS Code / Code::Blocks / Online
Compiler
Summary
• - C is powerful and efficient
• - Used widely in real-world applications
• - Mastering C builds strong programming
foundation
Q&A
• - Any questions?
• - Open discussion
Thank You
• Contact Info / Email
• [Optional quote on learning programming]