C Programming Notes
1. Introduction to C
- C is a general-purpose, procedural programming language.
- Developed in the early 1970s by Dennis Ritchie at Bell Labs.
- Used for system software, operating systems, embedded systems, and application development.
2. Structure of a C Program
#include <stdio.h>
int main() {
printf("Hello, World!\n");
return 0;
}
- #include <stdio.h>: Preprocessor directive to include standard input/output library.
- main(): Entry point of the program.
- printf(): Function to print output.
- return 0;: Ends the program.
3. Data Types
- Basic: int, float, char, double
- Derived: array, pointer, structure, union
4. Variables and Constants
- Variable: A named location in memory.
- Constant: A value that cannot be changed during execution.
1. Introduction to C
- C is a general-purpose, procedural programming language.
- Developed in the early 1970s by Dennis Ritchie at Bell Labs.
- Used for system software, operating systems, embedded systems, and application development.
2. Structure of a C Program
#include <stdio.h>
int main() {
printf("Hello, World!\n");
return 0;
}
- #include <stdio.h>: Preprocessor directive to include standard input/output library.
- main(): Entry point of the program.
- printf(): Function to print output.
- return 0;: Ends the program.
3. Data Types
- Basic: int, float, char, double
- Derived: array, pointer, structure, union
4. Variables and Constants
- Variable: A named location in memory.
- Constant: A value that cannot be changed during execution.