Mastering C Programming: From Basics to Advanced
Chapter 1: Introduction to C Programming
C is a general-purpose programming language developed in 1972 by
Dennis Ritchie.
It is powerful, efficient, and forms the foundation for many other
programming languages.
Features of C:
- Fast and efficient
- Procedural language
- Low-level access to memory
- Portable and structured
Example:
#include <stdio.h>
int main() {
printf("Hello, World!");
Mastering C Programming: From Basics to Advanced
return 0;
Output: Hello, World!
Chapter 2: Data Types and Variables
Data types in C define the type of data a variable can hold.
Basic Data Types:
- int: Integer numbers
- float: Floating point numbers
- char: Single characters
- double: Double-precision floating point
Example:
int age = 20;
float pi = 3.14;
Mastering C Programming: From Basics to Advanced
char grade = 'A';
Chapter 3: Operators and Expressions
Operators perform operations on variables and values.
Types of Operators:
- Arithmetic: +, -, *, /, %
- Relational: ==, !=, >, <, >=, <=
- Logical: &&, ||, !
- Assignment: =, +=, -=, etc.
Example:
int a = 5, b = 2;
int sum = a + b; // sum = 7