SlideShare a Scribd company logo
Author : Aamir Saleem Ansari
Web : www.techora.net
What is a program
Precise set of activities in a sequence to do something or to
solve some specific problem.
Computer Program
A computer program (also software, or just a program) is a
sequence of instructions written to perform a specified task with a
computer.
Set of ordered instructions that enable a computer to carry out a
specific task
 Is a way to communicate with each other
 Use to exchange (ideas, thoughts, needs,
emotions, feelings ) with each other
Programming Languages
 A computer language is a set of predefined words that are
combined into a program according to predefined rules (syntax)
Syntax
 Predefined set of rules to write the instructions in a
programming language is known as syntax.
 It’s a grammar of programming languages.
To write a program for a computer, we must use a
computer language. A computer language is a set of
predefined words that are combined into a program
according to predefined rules (syntax). Over the years,
computer languages have evolved from machine
language to high-level languages.
Evolution of programming languages
Machine languages
In the earliest days of computers, the only programming
languages available were machine languages. Each computer
had its own machine language, which was made of streams
of 0s and 1s.
i
The only language understood by a computer is machine
language.
Introduction to Programming Concepts By Aamir Saleem Ansari
Assembly languages
The next evolution in programming came with the idea of
replacing binary code for instruction and addresses with
symbols or mnemonics. Because they used symbols, these
languages were first known as symbolic languages. The set
of these mnemonic languages were later referred to as
assembly languages. The assembly language for our
hypothetical computer to replace the machine language in
Table 9.2 is shown in Program 9.1.
Introduction to Programming Concepts By Aamir Saleem Ansari
High-level languages
Although assembly languages greatly improved programming
efficiency, they still required programmers to concentrate on the
hardware they were using. Working with symbolic languages was also
very tedious, because each machine instruction had to be individually
coded. The desire to improve programmer efficiency and to change the
focus from the computer to the problem being solved led to the
development of high-level languages.
Over the years, various languages, most notably BASIC,
COBOL, Pascal, Ada, C, C++ and Java, were developed. Program 9.1
shows the code for adding two integers as it would appear in the C++
language.
#include<stdio.h>
#include<conio.h>
void main()
{
int n1,n2,n3;
printf(“Enter the first no”);
scanf(“%d”,&n1);
printf(“Enter the second no”);
scanf(“%d”,&n1);
n3 = n1 + n2;
printf(“ sum = %d “,n3);
getch();
}
Keyword:-
• Predefined words
which has special
meaning and purpose
in a programming
language
• C language has only
32 keywords
Keywords
auto double int struct
break else long switch
case enum register typedef
char extern return union
const float short unsigned
continue for signed void
default goto sizeof volatile
do if static while
Programs today are normally written in one of the high-
level languages. To run the program on a computer, the
program needs to be translated into the machine
language of the computer on which it will run. The
program in a high-level language is called the source
program. The translated program in machine language is
called the object program. Two methods are used for
translation: compilation and interpretation.
TRANSLATION
Compilation
A compiler normally translates the whole source program into the
object program.
Interpretation
Some computer languages use an interpreter to translate the source
program into the object program. Interpretation refers to the process of
translating each line of the source program into the corresponding line
of the object program and executing the line.
PROGRAMMING PARADIGMS
Today, computer languages are categorized according to
the approach they use to solve a problem. A paradigm,
therefore, is a way in which a computer language looks
at the problem to be solved. We divide computer
languages into four paradigms: procedural, object-
oriented, functional and declarative. Next diagram
summarizes these.
Introduction to Programming Concepts By Aamir Saleem Ansari
IDE (Integrated Development Environment)
IDE is a software that facilitate the programmer to
• Write the source code
• Debug the source code
• Compile the source code
• Execute the program
In a same environment.
Introduction to Programming Concepts By Aamir Saleem Ansari
Introduction to Programming Concepts By Aamir Saleem Ansari
Introduction to Programming Concepts By Aamir Saleem Ansari
 Write source code
 Vi and emacs for linux
 Eclipse, dev-c++, MS visual studio for
window
 In a C language, a preprocessor program
executes automatically before the compiler’s
translation phase begins.
 The C preprocessor obeys special commands
called preprocessor directives, which indicate
that certain manipulations are to be
performed on the program before
compilation.
 These manipulations usually consist of
including other files in the file to be compiled
and performing various text replacements.
 Check the syntax of whole program
 If there is an error compiler will display
the error in error window
 If there is no error then compiler
translate the source code into object
code
Compiler
First.c First.obj
 The next phase is called linking.
 C programs typically contain references
to functions defined elsewhere, such as
in the standard libraries or in the private
libraries of groups of programmers
working on a particular project.
 The object code produced by the C
compiler typically contains “holes” due to
these missing parts. A linker links the
object code with the code for the missing
functions to produce an executable
image (with no missing pieces).
Linker
First.obj First.exe
 Before a program can be executed, the
program must first be placed in memory. This
is done by the loader, which takes the
executable image from disk and transfers it
to memory.
 Finally, the computer, under the control
of its CPU, executes the program one
instruction at a time.
For More Info Visit :
www.techora.net

More Related Content

PPTX
Chapter 5
PPT
Language translator
PPTX
Compiler vs Interpreter-Compiler design ppt.
PPT
Computer programming concepts
PPTX
Computer programming
PPTX
Interpreter
DOC
PPTX
Interfacing With High Level Programming Language
Chapter 5
Language translator
Compiler vs Interpreter-Compiler design ppt.
Computer programming concepts
Computer programming
Interpreter
Interfacing With High Level Programming Language

What's hot (20)

PPTX
Computer programming project 15sec
PPTX
Translators(compiler assembler interpretor).
PPTX
Programming languages,compiler,interpreter,softwares
PPT
Computer Programming - Lecture 1
PPT
La 5 Pl Translator
PDF
Introduction to Computer Programming
PDF
Introduction to computer programming
PPT
Basic Programming Concept
PPT
software development and programming languages
PPTX
Language Translator ( Compiler)
PPTX
BASIC Programming Language
PPTX
Chapter 5-programming
PPTX
Language processor
PPTX
PPTX
Fundamentals of programming final
PPTX
Introduction to programming
PPSX
Programming languages
PPT
Computer languages 11
PPTX
PDF
Compilation v. interpretation
Computer programming project 15sec
Translators(compiler assembler interpretor).
Programming languages,compiler,interpreter,softwares
Computer Programming - Lecture 1
La 5 Pl Translator
Introduction to Computer Programming
Introduction to computer programming
Basic Programming Concept
software development and programming languages
Language Translator ( Compiler)
BASIC Programming Language
Chapter 5-programming
Language processor
Fundamentals of programming final
Introduction to programming
Programming languages
Computer languages 11
Compilation v. interpretation
Ad

Similar to Introduction to Programming Concepts By Aamir Saleem Ansari (20)

PPTX
PRESENTATION OF students learning outcomes.pptx
PPTX
1. C_Introductionnnnnnnnnnnnnnnnnnnnn.pptx
PPTX
Software programming and development
PPTX
Chapter 2 Program language translation.pptx
PPTX
1.Overview of Programming.pptx
PDF
Chapter1.pdf
DOCX
SYSTEM DEVELOPMENT
PDF
Introduction to Computer Programming (general background)
PPT
Introduction to Computer
PPT
Introduction to programing languages part 1
PDF
2 Programming Language.pdf
PPTX
Chapter 1.pptx compiler design lecture note
DOCX
Compliers and interpreters
PDF
Introduction to systems programming
PPTX
Introduction of C Programming
PDF
Unit 1
PPTX
Programming Fundamentals lecture 2
PDF
Introduction to compiler development
PPTX
Compiler design slide share
PRESENTATION OF students learning outcomes.pptx
1. C_Introductionnnnnnnnnnnnnnnnnnnnn.pptx
Software programming and development
Chapter 2 Program language translation.pptx
1.Overview of Programming.pptx
Chapter1.pdf
SYSTEM DEVELOPMENT
Introduction to Computer Programming (general background)
Introduction to Computer
Introduction to programing languages part 1
2 Programming Language.pdf
Chapter 1.pptx compiler design lecture note
Compliers and interpreters
Introduction to systems programming
Introduction of C Programming
Unit 1
Programming Fundamentals lecture 2
Introduction to compiler development
Compiler design slide share
Ad

Recently uploaded (20)

PDF
The Future of Smart Factories Why Embedded Analytics Leads the Way
PDF
Community & News Update Q2 Meet Up 2025
PDF
Exploring AI Agents in Process Industries
PPTX
Materi-Enum-and-Record-Data-Type (1).pptx
PDF
AI in Product Development-omnex systems
PDF
How Creative Agencies Leverage Project Management Software.pdf
PDF
Perfecting Gamer’s Experiences with Performance Testing for Gaming Applicatio...
PDF
How to Migrate SBCGlobal Email to Yahoo Easily
PPTX
Odoo Consulting Services by CandidRoot Solutions
PDF
Microsoft Teams Essentials; The pricing and the versions_PDF.pdf
PDF
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
PPTX
Hire Expert WordPress Developers from Brainwings Infotech
PDF
Become an Agentblazer Champion Challenge
PDF
2025 Textile ERP Trends: SAP, Odoo & Oracle
PPTX
Safe Confined Space Entry Monitoring_ Singapore Experts.pptx
PDF
IEEE-CS Tech Predictions, SWEBOK and Quantum Software: Towards Q-SWEBOK
PPTX
What to Capture When It Breaks: 16 Artifacts That Reveal Root Causes
DOCX
The Future of Smart Factories Why Embedded Analytics Leads the Way
PDF
How to Choose the Most Effective Social Media Agency in Bangalore.pdf
PDF
Build Multi-agent using Agent Development Kit
The Future of Smart Factories Why Embedded Analytics Leads the Way
Community & News Update Q2 Meet Up 2025
Exploring AI Agents in Process Industries
Materi-Enum-and-Record-Data-Type (1).pptx
AI in Product Development-omnex systems
How Creative Agencies Leverage Project Management Software.pdf
Perfecting Gamer’s Experiences with Performance Testing for Gaming Applicatio...
How to Migrate SBCGlobal Email to Yahoo Easily
Odoo Consulting Services by CandidRoot Solutions
Microsoft Teams Essentials; The pricing and the versions_PDF.pdf
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
Hire Expert WordPress Developers from Brainwings Infotech
Become an Agentblazer Champion Challenge
2025 Textile ERP Trends: SAP, Odoo & Oracle
Safe Confined Space Entry Monitoring_ Singapore Experts.pptx
IEEE-CS Tech Predictions, SWEBOK and Quantum Software: Towards Q-SWEBOK
What to Capture When It Breaks: 16 Artifacts That Reveal Root Causes
The Future of Smart Factories Why Embedded Analytics Leads the Way
How to Choose the Most Effective Social Media Agency in Bangalore.pdf
Build Multi-agent using Agent Development Kit

Introduction to Programming Concepts By Aamir Saleem Ansari

  • 1. Author : Aamir Saleem Ansari Web : www.techora.net
  • 2. What is a program Precise set of activities in a sequence to do something or to solve some specific problem. Computer Program A computer program (also software, or just a program) is a sequence of instructions written to perform a specified task with a computer. Set of ordered instructions that enable a computer to carry out a specific task
  • 3.  Is a way to communicate with each other  Use to exchange (ideas, thoughts, needs, emotions, feelings ) with each other Programming Languages  A computer language is a set of predefined words that are combined into a program according to predefined rules (syntax) Syntax  Predefined set of rules to write the instructions in a programming language is known as syntax.  It’s a grammar of programming languages.
  • 4. To write a program for a computer, we must use a computer language. A computer language is a set of predefined words that are combined into a program according to predefined rules (syntax). Over the years, computer languages have evolved from machine language to high-level languages. Evolution of programming languages
  • 5. Machine languages In the earliest days of computers, the only programming languages available were machine languages. Each computer had its own machine language, which was made of streams of 0s and 1s. i The only language understood by a computer is machine language.
  • 7. Assembly languages The next evolution in programming came with the idea of replacing binary code for instruction and addresses with symbols or mnemonics. Because they used symbols, these languages were first known as symbolic languages. The set of these mnemonic languages were later referred to as assembly languages. The assembly language for our hypothetical computer to replace the machine language in Table 9.2 is shown in Program 9.1.
  • 9. High-level languages Although assembly languages greatly improved programming efficiency, they still required programmers to concentrate on the hardware they were using. Working with symbolic languages was also very tedious, because each machine instruction had to be individually coded. The desire to improve programmer efficiency and to change the focus from the computer to the problem being solved led to the development of high-level languages. Over the years, various languages, most notably BASIC, COBOL, Pascal, Ada, C, C++ and Java, were developed. Program 9.1 shows the code for adding two integers as it would appear in the C++ language.
  • 10. #include<stdio.h> #include<conio.h> void main() { int n1,n2,n3; printf(“Enter the first no”); scanf(“%d”,&n1); printf(“Enter the second no”); scanf(“%d”,&n1); n3 = n1 + n2; printf(“ sum = %d “,n3); getch(); } Keyword:- • Predefined words which has special meaning and purpose in a programming language • C language has only 32 keywords
  • 11. Keywords auto double int struct break else long switch case enum register typedef char extern return union const float short unsigned continue for signed void default goto sizeof volatile do if static while
  • 12. Programs today are normally written in one of the high- level languages. To run the program on a computer, the program needs to be translated into the machine language of the computer on which it will run. The program in a high-level language is called the source program. The translated program in machine language is called the object program. Two methods are used for translation: compilation and interpretation. TRANSLATION
  • 13. Compilation A compiler normally translates the whole source program into the object program. Interpretation Some computer languages use an interpreter to translate the source program into the object program. Interpretation refers to the process of translating each line of the source program into the corresponding line of the object program and executing the line.
  • 14. PROGRAMMING PARADIGMS Today, computer languages are categorized according to the approach they use to solve a problem. A paradigm, therefore, is a way in which a computer language looks at the problem to be solved. We divide computer languages into four paradigms: procedural, object- oriented, functional and declarative. Next diagram summarizes these.
  • 16. IDE (Integrated Development Environment) IDE is a software that facilitate the programmer to • Write the source code • Debug the source code • Compile the source code • Execute the program In a same environment.
  • 20.  Write source code  Vi and emacs for linux  Eclipse, dev-c++, MS visual studio for window
  • 21.  In a C language, a preprocessor program executes automatically before the compiler’s translation phase begins.  The C preprocessor obeys special commands called preprocessor directives, which indicate that certain manipulations are to be performed on the program before compilation.  These manipulations usually consist of including other files in the file to be compiled and performing various text replacements.
  • 22.  Check the syntax of whole program  If there is an error compiler will display the error in error window  If there is no error then compiler translate the source code into object code Compiler First.c First.obj
  • 23.  The next phase is called linking.  C programs typically contain references to functions defined elsewhere, such as in the standard libraries or in the private libraries of groups of programmers working on a particular project.  The object code produced by the C compiler typically contains “holes” due to these missing parts. A linker links the object code with the code for the missing functions to produce an executable image (with no missing pieces). Linker First.obj First.exe
  • 24.  Before a program can be executed, the program must first be placed in memory. This is done by the loader, which takes the executable image from disk and transfers it to memory.
  • 25.  Finally, the computer, under the control of its CPU, executes the program one instruction at a time.
  • 26. For More Info Visit : www.techora.net