Introduction To C Programming
C is a powerful and versatile programming language developed by Dennis Ritchie at Bell Labs in the early 1970s. It is a procedural, general-purpose language renowned for its efficiency, flexibility, and low-level memory access — forming the backbone of modern operating systems and embedded systems worldwide.
Key Features of C
Procedural
Programs are organized into functions, following a clear top-down procedural style.
Portability
Write once, compile anywhere — C programs run across multiple platforms with minimal changes.
Efficiency
Direct hardware access and fast execution make C perfect for systems programming.
Modularity
Functions and libraries promote clean, reusable, well-organized code.
Static Typing
Data types are resolved at compile time, catching errors before runtime.
Low-Level Access
C provides direct memory manipulation using pointers, making it ideal for operating systems and embedded development.
Syntax
- C syntax is clean and minimal — designed for clarity and speed.
- Programs use keywords, identifiers, operators, and special symbols.
- Every statement ends with a semicolon ( ; ) to mark its completion.
- Code blocks are grouped inside curly braces { }.
Data Types
| Type | Description | Size | Example |
|---|---|---|---|
| int | Stores whole integers | 4 bytes | int x = 5; |
| char | Stores a single character | 1 byte | char c = 'A'; |
| float | Single-precision decimal | 4 bytes | float f = 3.14; |
| double | Double-precision decimal | 8 bytes | double d = 9.99; |
Variables & Constants
- Variables are named memory slots used to store data during a program's execution.
- All variables must be declared with a type before they can be used.
- Constants are fixed values that do not change during program execution.
- Use the const keyword to declare a read-only constant variable.
Operators
Control Flow
Decisions
if and else run code based on true or false conditions.
Switch
switch handles multiple conditions in a clean, readable way.
Loops
for, while, and do-while repeat blocks of code.
Standard Library
Standard I/O — provides printf() for output and scanf() for input.
Standard Library — utility functions like malloc(), free(), and exit().
Math functions — sqrt(), pow(), fabs() and more.
Your First C Program
#include<stdio.h>
main()
{
printf("Hello, PBA INSTITUTE");
}
Examples
#include<stdio.h>
main()
{
int a=2, b=3, c=5, l=6, e=1;
e = a + b + c + l;
printf("sum=%d", e);
}
#include<stdio.h>
main()
{
int a=6, b;
b = a * a;
printf("Area of square=%d", b);
}
Conclusion
C remains one of the most important programming languages in computer science. It gives you a deep understanding of how programs work at the hardware level, memory management, and algorithmic thinking. Consistent practice with real programs is the fastest path to mastering C — keep writing code every day!