C PROGRAMMING – LONG NOTES
1. HISTORY OF C
C language was developed by Dennis Ritchie in 1972 at AT&T; Bell Laboratories. It was developed
for the UNIX operating system. C is a middle-level language supporting both low-level and
high-level programming features.
2. PROGRAMMING IN C
A C program consists of preprocessor directives, main function, and user-defined functions. Every
program execution starts from main().
3. DECISION MAKING
Decision-making statements allow the program to execute different paths based on conditions.
Types include if, if-else, else-if ladder, and switch.
4. LOOPING STATEMENTS
Loops are used to repeat code. Types include for loop, while loop, and do-while loop. Control
statements include break and continue.
5. ARRAYS
Arrays store multiple values of the same data type. Types include one-dimensional and
two-dimensional arrays.
6. STORAGE CLASSES
Storage classes define scope and lifetime of variables. Types include auto, register, static, and
extern.
7. STRUCTURES
Structures group different data types under one name and are used to store complex data.
8. FUNCTIONS
Functions are reusable blocks of code. They can be user-defined or library functions.
9. POINTERS
Pointers store the address of a variable and are used for dynamic memory allocation and call by
reference.
10. FILE MANAGEMENT
File handling allows permanent storage of data using functions like fopen, fprintf, fscanf, and fclose.
11. GRAPHICS
Graphics in C are created using graphics.h library to draw shapes like lines, circles, and rectangles.