C Language: A general-purpose, procedural programming language
developed in the early 1970s by Dennis Ritchie. It is widely used for
system and application software.
Basic Concepts
1. Syntax:
Statements: End with a semicolon (`;`).
-Blocks: Group of statements enclosed in curly braces (`{ }`).
2. Data Types:
Primary: `int`, `char`, `float`, `double`
Derived: Arrays, Pointers, Structures, Unions
3. Variables:
• Declared to store data.
• Syntax: `data_type variable_name;` (e.g., `int age;`)
4. Operators:
- Arithmetic: `+`, `-`, `*`, `/`, `%`
- Relational: `==`, `!=`, `>`, `<`, `>=`, `<=`
- Logical: `&&`, `||`, `!`
Control Structures
, 1. Conditional Statements:
• `if`, `else if`, `else`
•Syntax:
If (condition) {
// statements
} else {
// statements
}
2. Loops:
• for loop:
For (initialization; condition; increment) {
// statements
}
• while loop:
While (condition) {
// statements
}
•do-while loop:
2