C Programming - Easy Notes
What is C?
C is a general-purpose programming language. It is fast, simple, and widely used for system and
application development.
Basic Structure
Header files, main() function, declarations, statements, return 0;
Variables
Variables store data. Example: int age=18;
Data Types
int, float, char, double.
Operators
Arithmetic (+,-,*,/), Relational (>,<), Logical (&&,||,! ).
Control Statements
if, if-else, switch, for, while, do-while.
Functions
Functions divide programs into reusable blocks.
Arrays
Collection of same type elements.
Strings
Character arrays ending with '\0'.
Pointers
Store memory addresses. Example: int *p=&x;
Structures
Group different data types together.
File Handling
Use fopen(), fprintf(), fscanf(), fclose().
Example Program
#include <stdio.h>
int main(){
printf("Hello, World!");
return 0;
}