C Programming - Unit 1 (Introduction & Basics)
Introduction to C
C is a powerful, general-purpose programming language developed by Dennis Ritchie at AT&T;
Bell Labs in 1972.
It is widely used for system programming, embedded systems, and application development.
C is known as a middle-level language because it combines low-level and high-level features.
Features of C Language
Simple and efficient language.
Portable and machine independent.
Rich library support.
Structured programming language.
Structure of C Program
A C program consists of: Documentation section, Link section, Definition section, Global
declaration, Main function, and Sub-programs.
#include <stdio.h>
int main() {
printf("Hello World");
return 0;
}
Data Types and Variables
Basic data types: int, float, double, char.
Variables are used to store data values.
Example: int age = 20;
Operators in C
Arithmetic Operators: +, -, *, /, %
Relational Operators: ==, !=, >, <, >=, <=
Logical Operators: &&, ||, !