SlideShare a Scribd company logo
Computer
Programming
Computer Programming
 Computer programming is the process of
writing instructions that direct a computer to
carry out specific tasks
 A computer program is a set of step-by-
step instructions that tell a computer how to
solve a problem or carry out a task
 The instructions that make up a computer program
are often referred to as code
 A program is written in a computer programming
language
Programming Languages (-1-)
 A programming language is an artificial
language designed for creating instructions that a
computer can carry out
 In contrast, the languages we speak [e.g., English / Urdu] are
natural languages
 Programming languages differ from natural
languages in that
 natural languages are used for interaction between people
 programming languages allow humans to communicate
instructions to machines as well as machine-to-machine
interaction
Programming Languages (-2-)
 Programming languages can be divided into two major
categories
 Low-level languages
 Require the programmer to write instructions for the lowest level of
computer’s hardware
 Easy for computer to understand; Difficult for humans
 Examples: Machine Language, Assembly Language
 High-level languages
 Makes programming process easier by providing commands such
as PRINT or WRITE instead of unintelligible strings of 1s and 0s
 Examples: FORTRAN, C, C++, Java, Python …
 Languages can also be categorized by generations
LOW-LEVEL
LANGUAGES
Programming Language
Categorization
HARDWARE
MACHINE LANGUAGE
ASSEMBLY
LANGUAGE
HIGH-LEVEL
LANGUAGES
1st
Generation
Language [1GL]
2GL
3GL, 4GL
Machine Language /
Machine Code
 The first languages for programming computers – sometimes
referred to as first-generation languages
 A machine language consists of a set of commands,
represented as a series of 1s and 0s, corresponding to the
instruction set understood by a microprocessor
 A machine language is specific to a particular CPU or
microprocessor family
 High-level languages are (mostly) translated [compiled] to
machine language in order to be understood and executed by
the microprocessor
Example
Add the registers 1 and 2. Place the result in
register 6.
[ op | rs | rt | rd | shamt | funct ]
0 1 2 6 0 32
decimal 000000 00001 00010 00110 00000
100000 binary
Machine Language /
Machine Code
Assembly Language
 Allows programmers to use abbreviated
command words rather than 1s and 0s used in
machine languages
 A significant improvement over machine languages
 Mnemonics such as ADD, SUB, MUL, DIV, JMP etc are
more understandable than 0001, 0100 etc
 Also referred to as second-generation languages
 Assembly languages are also machine specific
 Each assembly language command corresponds on a
one-to-one basis to a machine language instruction
Assembly Language
Example 1
Add 10 to the variable MARKS
ADD MARKS, 10
Example 2
Transfer the value 10 to the AL register
MOV AL, 10
High-level languages
C/C++, JAVA, BASIC and etc.
 Similar to everyday English,
 Use mathematical notations
Example 1
Add 10 to the variable MARKS
MARKS = MARKS + 10;
Example 2
Assign the value 10 to the variable A, value 20 to variable B,
add them and store the results in variable C
A = 10; B = 20;
C = A + B;
Next
 Now we move on to: C How to Program

More Related Content

PDF
C_NOTES.pdf
PPSX
Programming languages
PPTX
INTRODUCTION TO COMPUTER PROGRAMMING.pptx
PPTX
COM 113 INTRO TO COMPUTER PROGRAMMING-PRT2.pptx
PPTX
introduction to programming languages
PPTX
1 INTRODUCTION.pptxAAAAAAAAAAAAAAAAAAAAAAAAAAA
PPTX
Computer Languages & its genearations.pptx
C_NOTES.pdf
Programming languages
INTRODUCTION TO COMPUTER PROGRAMMING.pptx
COM 113 INTRO TO COMPUTER PROGRAMMING-PRT2.pptx
introduction to programming languages
1 INTRODUCTION.pptxAAAAAAAAAAAAAAAAAAAAAAAAAAA
Computer Languages & its genearations.pptx

Similar to Basic Introduction to Computer Programming.ppt (20)

PPTX
Lec21&22.pptx programing language and there study
PPTX
Computer languages
PPTX
week 1 - INTRO TO PROGRAMMING.pptx
PPTX
C++ programming languages lectures
PPT
Computer languages 11
PPTX
Data programming with the minimum hocker
PPT
Computer languages and generation
PPT
Software Engineering : Computer basics - Introduction to computer
PPT
Computer languages
PPTX
1.Overview of Programming.pptx
PPTX
Evolution of programming languages-migara presentation.pptx
PPTX
Computer Topic (Introduction to Programming).pptx
PPTX
Computer programming, low level and high level languages
PPTX
Intro to programming languages by 4.pptx
PPTX
01-PROGRAMMING introA of the class name. Pptx
PPTX
COMPUTER LANGUAGES programming languages.pptx
PDF
Introduction to computer programming
PDF
sege.pdf
PPTX
Programming languages.pptx
PDF
Languages in computer
Lec21&22.pptx programing language and there study
Computer languages
week 1 - INTRO TO PROGRAMMING.pptx
C++ programming languages lectures
Computer languages 11
Data programming with the minimum hocker
Computer languages and generation
Software Engineering : Computer basics - Introduction to computer
Computer languages
1.Overview of Programming.pptx
Evolution of programming languages-migara presentation.pptx
Computer Topic (Introduction to Programming).pptx
Computer programming, low level and high level languages
Intro to programming languages by 4.pptx
01-PROGRAMMING introA of the class name. Pptx
COMPUTER LANGUAGES programming languages.pptx
Introduction to computer programming
sege.pdf
Programming languages.pptx
Languages in computer
Ad

Recently uploaded (20)

PDF
Computing-Curriculum for Schools in Ghana
PPTX
Share_Module_2_Power_conflict_and_negotiation.pptx
PDF
Τίμαιος είναι φιλοσοφικός διάλογος του Πλάτωνα
PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
PDF
Vision Prelims GS PYQ Analysis 2011-2022 www.upscpdf.com.pdf
PDF
AI-driven educational solutions for real-life interventions in the Philippine...
PPTX
Unit 4 Computer Architecture Multicore Processor.pptx
PPTX
B.Sc. DS Unit 2 Software Engineering.pptx
PDF
Practical Manual AGRO-233 Principles and Practices of Natural Farming
PPTX
A powerpoint presentation on the Revised K-10 Science Shaping Paper
PDF
A GUIDE TO GENETICS FOR UNDERGRADUATE MEDICAL STUDENTS
PPTX
Virtual and Augmented Reality in Current Scenario
PPTX
Computer Architecture Input Output Memory.pptx
PDF
RTP_AR_KS1_Tutor's Guide_English [FOR REPRODUCTION].pdf
PDF
Trump Administration's workforce development strategy
PDF
Weekly quiz Compilation Jan -July 25.pdf
PDF
Chinmaya Tiranga quiz Grand Finale.pdf
PDF
IGGE1 Understanding the Self1234567891011
PDF
What if we spent less time fighting change, and more time building what’s rig...
PPTX
20th Century Theater, Methods, History.pptx
Computing-Curriculum for Schools in Ghana
Share_Module_2_Power_conflict_and_negotiation.pptx
Τίμαιος είναι φιλοσοφικός διάλογος του Πλάτωνα
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
Vision Prelims GS PYQ Analysis 2011-2022 www.upscpdf.com.pdf
AI-driven educational solutions for real-life interventions in the Philippine...
Unit 4 Computer Architecture Multicore Processor.pptx
B.Sc. DS Unit 2 Software Engineering.pptx
Practical Manual AGRO-233 Principles and Practices of Natural Farming
A powerpoint presentation on the Revised K-10 Science Shaping Paper
A GUIDE TO GENETICS FOR UNDERGRADUATE MEDICAL STUDENTS
Virtual and Augmented Reality in Current Scenario
Computer Architecture Input Output Memory.pptx
RTP_AR_KS1_Tutor's Guide_English [FOR REPRODUCTION].pdf
Trump Administration's workforce development strategy
Weekly quiz Compilation Jan -July 25.pdf
Chinmaya Tiranga quiz Grand Finale.pdf
IGGE1 Understanding the Self1234567891011
What if we spent less time fighting change, and more time building what’s rig...
20th Century Theater, Methods, History.pptx
Ad

Basic Introduction to Computer Programming.ppt

  • 2. Computer Programming  Computer programming is the process of writing instructions that direct a computer to carry out specific tasks  A computer program is a set of step-by- step instructions that tell a computer how to solve a problem or carry out a task  The instructions that make up a computer program are often referred to as code  A program is written in a computer programming language
  • 3. Programming Languages (-1-)  A programming language is an artificial language designed for creating instructions that a computer can carry out  In contrast, the languages we speak [e.g., English / Urdu] are natural languages  Programming languages differ from natural languages in that  natural languages are used for interaction between people  programming languages allow humans to communicate instructions to machines as well as machine-to-machine interaction
  • 4. Programming Languages (-2-)  Programming languages can be divided into two major categories  Low-level languages  Require the programmer to write instructions for the lowest level of computer’s hardware  Easy for computer to understand; Difficult for humans  Examples: Machine Language, Assembly Language  High-level languages  Makes programming process easier by providing commands such as PRINT or WRITE instead of unintelligible strings of 1s and 0s  Examples: FORTRAN, C, C++, Java, Python …  Languages can also be categorized by generations
  • 6. Machine Language / Machine Code  The first languages for programming computers – sometimes referred to as first-generation languages  A machine language consists of a set of commands, represented as a series of 1s and 0s, corresponding to the instruction set understood by a microprocessor  A machine language is specific to a particular CPU or microprocessor family  High-level languages are (mostly) translated [compiled] to machine language in order to be understood and executed by the microprocessor
  • 7. Example Add the registers 1 and 2. Place the result in register 6. [ op | rs | rt | rd | shamt | funct ] 0 1 2 6 0 32 decimal 000000 00001 00010 00110 00000 100000 binary Machine Language / Machine Code
  • 8. Assembly Language  Allows programmers to use abbreviated command words rather than 1s and 0s used in machine languages  A significant improvement over machine languages  Mnemonics such as ADD, SUB, MUL, DIV, JMP etc are more understandable than 0001, 0100 etc  Also referred to as second-generation languages  Assembly languages are also machine specific  Each assembly language command corresponds on a one-to-one basis to a machine language instruction
  • 9. Assembly Language Example 1 Add 10 to the variable MARKS ADD MARKS, 10 Example 2 Transfer the value 10 to the AL register MOV AL, 10
  • 10. High-level languages C/C++, JAVA, BASIC and etc.  Similar to everyday English,  Use mathematical notations Example 1 Add 10 to the variable MARKS MARKS = MARKS + 10; Example 2 Assign the value 10 to the variable A, value 20 to variable B, add them and store the results in variable C A = 10; B = 20; C = A + B;
  • 11. Next  Now we move on to: C How to Program