Professional Documents
Culture Documents
Unit 1
Unit 1
Unit-I
Programming Language Concepts
• What is a programming language?
• Why are there so many programming languages?
• What are the types of programming languages?
• Does the world need new languages?
What is a programming language?
Programming Language is
English is a natural language. It has words, symbols A programming language also has words, symbols and
and grammatical rules. rules of grammar.
The grammatical rules are called syntax. Each programming language has a different set of
syntax rules.
Why So Many Programming languages
As there are various languages to speak similarly different
programming languages are designed for different types of programs.
Types of Programming Language
• Programs written in high-level languages are translated into assembly
language or machine language by a compiler.
• Assembly language programs are translated into machine language by
a program called an assembler.
High Level Language
• A high-level language is a programming language such as
C, FORTRAN, or Pascal that enables a programmer to write
programs that are more or less independent of a particular
type of computer.
• Such languages are considered high-level because they are
closer to human languages.
Compiler
We will discuss:
What is Program?
Algorithm
Program
• A program is a set of instructions following the rules of
the chosen language.
NOTE:
- The first two generations are called low level
languages. The next three generations are called
high level languages.
POLL
Q. How many computer programming generations we
studied?
a)1
b)2
c)3
d)4
e)5
Algorithm
Programming is the process of taking an algorithm.
• Step1: Start.
• Step2: Take the two numbers.
• Step3: Add the two numbers.
• Step4: Print the result.
• Step5: Stop.
Program to add two numbers
#include <stdio.h>
int main() {
int number1, number2, sum;
printf("Enter two integers: ");
scanf("%d %d", &number1, &number2);
// calculate the sum
sum = number1 + number2;
printf("%d + %d = %d", number1, number2, sum);
return 0;
}
POLL
Q. Algorithm is defined as “ the ________set of steps, which provide a
chain of action for solving a _______”.
a)temporary, instruction
b)actual, issue
c)instruction, problem
d)finite, problem
We will discuss:
a) Compiler
b) Interpreter
c) Assembler
d) Converter
POLL
Q. Which of the following is called low level languages?
a)Machine language
b)Assembly language
c)Both a and b
d)None of above
Flow Chart Symbols
Example: Addition of 2 numbers
START
TAKE TWO
NUMBERS A and B
FIND SUM=A+B
PRINT SUM
STOP
Programming Methodologies
The approach to analyzing complex problems, planning for
software development and controlling the development
process is called programming methodology.
For example:
When programs are developed to solve real-life problems
like inventory management, payroll processing, student
admissions, examination result processing etc. They all
tend to be complex.
Types of Programming
Methodologies
Procedural Programming
Functional Programming
a)Assembler
b)System software
c)Compiler
d)Translator
POLL
Q. What is true about machine language