C Programming Language Assignment
Part I – History and Background
1. History of the C Programming Language
- Developed by Dennis Ritchie.
- Created in the early 1970s (around 1972) at Bell Labs, USA.
- Originally designed to develop the UNIX operating system.
2. Why C is Considered a Middle-Level Language
C combines low-level features like memory access using pointers with high-level structured
programming features such as functions and loops.
3. Programming Languages Influenced by C
- C++: Adds object-oriented programming to C.
- Java: Uses similar syntax and structure inspired by C.
- C#: Developed by Microsoft with C-like syntax for modern applications.
Part II – Core Concepts
4. Structure of a Basic C Program
- #include: Includes header files such as stdio.h for input/output functions.
- main(): Entry point of the program.
- Variables: Store data (e.g., int number = 10;).
- return 0;: Indicates successful program execution.
5. Data Types in C
Basic Types:
- int: Integer values (e.g., int age = 20;)
- float: Decimal values (e.g., float price = 19.99;)
- double: High precision decimal values
- char: Single character (e.g., char grade = 'A';)
Derived Types:
- Array: Collection of same data type (int nums[5];)
- Pointer: Stores memory address (int *ptr;)
- Struct: Groups different data types
Void Type:
- void: Represents no value (e.g., void display();)
6. Operators in C
Arithmetic Operators: +, -, *, /, %
Relational Operators: ==, !=, >, <
Logical Operators: &&, ||, !
Assignment Operators: =, +=, -=