Introduction to Programming
Last Updated : Jan 2026
Before learning C syntax, we first need to understand what programming actually is.
Programming is the process of giving instructions to a computer to perform a task.
For example, suppose you want a computer to calculate the total price of two products.
You need to tell it:
1. Take the price of product 1
2. Take the price of product 2
3. Add both prices
4. Display the result
These instructions are called a program when written in a programming language.But how we pass these instructions to a computer?
So are Different way to pass instructions to a computer.
Machine Language
A computer fundamentally works with machine instructions i.e machine language/binary code (0 and 1).It is Hardware specific (machine-dependent).
Humans don't want to write everything directly in machine language such as:
10110000 01100001
11001010 00010110
Assembly Language
Assembly language is a subset of machine language.In which we write instructions in a human-readable form but still close to hardware.
- Use mnemonics like MOV, ADD, SUB.
- Requires assembler to convert it into machine code.
Like:
ADD r1, r2, r3
SUB r4, r5, r6
Low-level Languages
Low-level languages are similar to assembly languages.In which we write instructions much more efficiently,but still close to hardware.
For example:
a=10
b=20
c=a+b
High-level Languages
High-level languages are more user-friendly.In which we write instructions in a human-readable form and hardware-independent (portable).
Programming Language?
A programming language is a language used to communicate instructions to a computer. Examples:
C
C++
Java
Python
JavaScript
Go
Rust
C#
Each language has its own:
- Syntax
- Keywords
- Rules
- Features
For example, printing something in C:
printf("Hello");
Python:
print("Hello")
Java:
System.out.println("Hello");
The goal is the same, but the syntax is different. So programming languages allow us to write instructions in a form that humans can understand.
Note : Each Programming Language is type of any of these i.e Machine Language, Assembly Language, Low-level Language, High-level Language.
Compilation
You may think if machine only understand machine language. then how it understands human language?
The answer is compilation.
A compilation process that converts human-readable code into machine code that the computer can execute.It is done by a two ways:
- Compiler
- Interpreter
Compiler
Convert whole program to machine code in a single step.
- It make Object code which is directly executable by the computer.
- Show all errors at once.
C
C++
Rust
Interpreter
A step by step process that converts human-readable code into machine code that the computer can execute.
- Typically executes source code through an interpreter/runtime rather than first producing a standalone native executable in the same way.
- Show errors one at a time,After Error it Stops.
Python is commonly described this way, although modern language implementations can involve multiple stages such as bytecode and JIT compilation.
For now, remember:
C → Compiler
Python → Interpreter-based runtime
Programming Paradigm
A programming paradigm is a way of thinking about programming.It is the "mindset" or "blueprint" you use to solve a problem with code. It is not a tool or a language itself, but rather the underlying philosophy that determines how you organize your thoughts, structure your data, and write your instructions.
There are many programming paradigms:
- Procedural Programming (PP)
- Functional Programming (FP)
- Object-Oriented Programming (OOP)
Procedural Programming (PP)
Procedural programming is a way of thinking about programming that uses a step-by-step approach to solve a problem,Just a sequence of instructions one after the another.
For example:
1. Take the price of product 1
2. Take the price of product 2
3. Add both prices
4. Display the result
Functional Programming (FP)
Functional programming is a way of thinking about programming that uses functions as the building blocks for solving a problem.
For example:
1. Take the price of product 1
2. Take the price of product 2
3. Pass both prices to a function where you add them
4. Display the result
Object-Oriented Programming (OOP)
Object-oriented programming is a way of organizing code into classes(blueprints) and objects(instances of classes).
For example:
1. Create a class called "Product"
2. Create two objects of class "Product"
3. Pass the objects to a function where you add their prices
4. Display the result
Programming Process
This is one of the most important concepts in programming. The general process is:
Problem
↓
Algorithm
↓
Program
↓
Output
Suppose the problem is:
Find the sum of two numbers.
Step 1 — Problem
Find the sum of two numbers.
Step 2 — Algorithm
We think about the solution:
1. Take first number
2. Take second number
3. Add them
4. Display the result
Step 3 — Program
Later, we will write the algorithm in a programming language.Let suppose we are writing in C.:
sum = a + b;
Step 4 — Output
If:
a = 10
b = 20
then:
sum = 30
What is an Algorithm?
An algorithm is a step-by-step procedure for solving a problem. For example:
Find whether a number is positive or negative.
Algorithm
1. Start
2. Take a number
3. Check whether number > 0
4. If yes, display "Positive"
5. Otherwise, display "Negative"
6. Stop
Notice something important: We haven't written any C syntax yet. We are concentrating on logic first. That's exactly how we should approach programming.
Common Questions
Where we write the program?
An IDE (Integrated Development Environment) provides tools for writing and working with programs.
Examples:
- Visual Studio Code
- Code::Blocks
- CLion
- Dev-C++
An IDE may provide:
Code Editor
Compiler Integration
Debugger
Terminal
Error Messages
Project Management
You can also write code without a full IDE using a text editor and compiler.
First Mental Model of Programming, Whenever you receive a programming problem, think:
PROBLEM
↓
What is given?
↓
What is required?
↓
What operations are needed?
↓
ALGORITHM
↓
PROGRAM
↓
OUTPUT
This mental process is more important than memorizing syntax.
