What is a Programming Language?
A programming language is a formal way of communicating with a computer. It is used
to write a set of instructions, called a program, that tells the computer what to do.
Just like we use human languages (like English or Tamil) to speak to each other,
programmers use programming languages to speak to computers.
🧠 Why Are Programming Languages Important?
Computers are machines — they only understand binary language (0s and 1s). Writing in
binary is very difficult for humans, so programming languages were developed to make
communication easier.
Programming languages act as a bridge between humans and machines.
🔍 Types of Programming Languages
1. Low-Level Languages (closer to machine)
Machine Language (binary code)
Assembly Language (uses short mnemonics like ADD, SUB)
Faster but harder to understand
2. High-Level Languages (closer to human)
Examples: C, C++, Java, Python
Easier to read and write
Must be translated into machine language using compilers or interpreters
🧠 Components of a Programming Language
🔤 Syntax
The rules of how to write code
Example: Every statement in C ends with ;
📖 Semantics
The meaning of the code
Example: a = b + c; means “add b and c, then store it in a”
🏗️ Categories / Paradigms of Programming Languages
1. Procedural (step-by-step instructions)
Example: C, Pascal
Programs are made of functions and procedures
2. Object-Oriented
Example: Java, C++
Focus on objects and classes
3. Functional
Example: Haskell, Lisp
Focus on pure functions and mathematical logic
4. Scripting
Example: Python, JavaScript
Easy to write and used for automation, web pages, etc.
🔧 How Does a Programming Language Work?
1. You write a program in a high-level language (like C).
2. It is converted into machine language using:
o A compiler (converts all code at once) OR
o An interpreter (converts one line at a time)
3. The CPU executes the machine instructions to perform the task.
. What is a Programming Language?
A programming language is a set of instructions used to communicate with a
computer.
Computers do not understand human languages like English or Tamil, so we use
programming languages to write code.
💬 Examples of Programming Languages:
C, C++, Java, Python, JavaScript, etc.
🧠 2. Why Learn C Language First?
C is called the "Mother of All Languages" because many languages like C++, Java,
and Python are influenced by it.
It teaches you how a program interacts with memory, how variables work, and how
logic is built.
🔧 3. Features of C Language
Simple and easy to learn
Fast execution
Structured programming language
Used to build system software, operating systems, and compilers
🏗️ 4. Structure of a Simple C Program
c
CopyEdit
#include <stdio.h> // Header file
int main() { // Main function starts here
printf("Welcome to BCA!\n"); // Output
return 0; // End of program
}
🔍 Explanation:
#include <stdio.h> – Tells the compiler to include standard input/output functions.
main() – Starting point of every C program.
printf() – Prints text on the screen.
return 0; – Ends the program successfully.
✍️ 5. Simple Programs to Practice
✅ Program 1: Print Hello
c
CopyEdit
#include <stdio.h>
int main() {
printf("Hello, World!");
return 0;
}
✅ Program 2: Add Two Numbers
c
CopyEdit
#include <stdio.h>
int main() {
int a = 10, b = 20, sum;
sum = a + b;
printf("Sum is: %d", sum);
return 0;
}
✅ Program 3: Check Even or Odd
c
CopyEdit
#include <stdio.h>
int main() {
int num;
printf("Enter a number: ");
scanf("%d", &num);
if(num % 2 == 0)
printf("Even Number");
else
printf("Odd Number");
return 0;
}
✅ Program 4: Use of Loop
c
CopyEdit
#include <stdio.h>
int main() {
for(int i = 1; i <= 5; i++) {
printf("Welcome %d\n", i);
}
return 0;
}