SlideShare una empresa de Scribd logo
1 de 16
COMPUTER
PROGRAMMING
What is Programming?
Programming is a creative process that
instructs a computer on how to do a task.
Find out more about the different types of
programming.
WHAT IS A PROGRAMMING LANGUAGE?
 Coded language used by programmers to
write instructions that a computer can
understand to do what the programmer
HISTORY OF PROGRAMMING LANGUAGE
1954 - FORTRAN ("Formula Translation“)
Hello , World!
Source code Output
is a general-purpose, imperative programming language that is
especially suited to numeric computation and scientific computing.
1970 - Pascal
a high-level structured computer programming language
used for teaching and general programming.
Hello World
Source code Output
1983 - C++
Source code
Hello World
Output
is a general-purpose programming language. It has imperative,
object-oriented and generic programming features, while also
providing facilities for low-level memory manipulation.
C - 1978
is a powerful general-purpose programming
language. It is fast, portable and available in all
platforms.
Hello World
Source code
Output
1991 – Java
Source code
Hello , World
Output
a general-purpose computer programming language designed to
produce programs that will run on any computer system.
THERE ARE THREE MAIN KINDS OF
PROGRAMMING LANGUAGE:
 Machine language.
 Assembly language.
 High-level language.
C PROGRAMMING LANGUAGE
Input output Libraries
Header File
#include<stdio.h>
Functions
Printf()
Scanf()
#include<conio.h>
Functions
Getch()
Textcolor()
Textbackground()
Main()
{
//Data types Declaration
Type
Keyword
Boolean = Bool
Integer = int
Floating point = float
Character =
char
//Variables Declaration
Variables are part of almost every program
A variable is a “place to put data” and is
usually represented by a letter or a word.
EXAMPLE 1 – A SIMPLE PAYROLL PROGRAM
A Simple Payroll Program
Output
Name:
Basic
Pay:Tax :
Net
Pay:
Joemarie
5,000
500
4,500
THE CORRESPONDING C PROGRAM
#include<stdio.h>
#include<conio.h>
main()
{
// Data Types and Variable Declaration
char name;
int basicpay,tax,netpay;
printf("A Simple Payroll Programn");
printf("Name:");scanf("%s",&name);
printf(" basicpay :");scanf("%d",&basicpay);
printf("Tax:");scanf("%d",&tax);
// formula
netpay=basicpay-tax;
printf("Net Pay: %d",netpay);
getch();
}
Example 2 – A simple Payroll Program using If
Statement
A Simple Payroll Program
Name:
Basic Pay:
Tax :
Net
Pay:
Key in Employee's Data
Employee's
Code:
Joemarie
a
5,000
500
4,500
THE CORRESPONDING C PROGRAM USING IF STATEMENT
#include<stdio.h>
#include<conio.h>
main()
{
// Data Tpyes and Variable Declaration
char name;
char empcode;
int basicpay,tax,netpay;
printf(" A Simple Payroll Programn");
printf(" Key in Employee's Datan");
printf("Name:");scanf("%s",&name);
printf("Employee's Code:");scanf("%s",&empcode);
if(empcode=='a')
basicpay=5000;
else if(empcode=='b')
basicpay=6000;
else if(empcode=='c')
basicpay=7000;
else if(empcode=='d')
basicpay=8000;
else if(empcode=='e')
basicpay=9000;
printf("Basic Pay: %d",basicpay);
printf("n");
printf("Tax:");scanf("%d",&tax);
// formula
netpay=basicpay-tax;
printf("Net Pay: %d",netpay);
getch();
}
LOGICAL ERROR
is a mistake in a program's source code that results in
incorrect or unexpected behavior.
It is a type of runtime error that may simply produce the
wrong output or may cause a program to crash while
running
SYNTAX ERROR
A syntax error is an error in the source code
of a program.
Assignment

Más contenido relacionado

La actualidad más candente

Lect 1. introduction to programming languages
Lect 1. introduction to programming languagesLect 1. introduction to programming languages
Lect 1. introduction to programming languages
Varun Garg
 
Introduction to computer programming
Introduction to computer programmingIntroduction to computer programming
Introduction to computer programming
NSU-Biliran Campus
 
Intro To Programming Concepts
Intro To Programming ConceptsIntro To Programming Concepts
Intro To Programming Concepts
Jussi Pohjolainen
 
Looping statements in Java
Looping statements in JavaLooping statements in Java
Looping statements in Java
Jin Castor
 

La actualidad más candente (20)

C++ Overview PPT
C++ Overview PPTC++ Overview PPT
C++ Overview PPT
 
Lect 1. introduction to programming languages
Lect 1. introduction to programming languagesLect 1. introduction to programming languages
Lect 1. introduction to programming languages
 
Programming Fundamentals lecture 1
Programming Fundamentals lecture 1Programming Fundamentals lecture 1
Programming Fundamentals lecture 1
 
Algorithms and flowcharts
Algorithms and flowchartsAlgorithms and flowcharts
Algorithms and flowcharts
 
Java
JavaJava
Java
 
Introduction to computer programming
Introduction to computer programmingIntroduction to computer programming
Introduction to computer programming
 
Algorithm and flowchart
Algorithm and flowchartAlgorithm and flowchart
Algorithm and flowchart
 
Introduction to c#
Introduction to c#Introduction to c#
Introduction to c#
 
Introduction to c++ ppt 1
Introduction to c++ ppt 1Introduction to c++ ppt 1
Introduction to c++ ppt 1
 
Types of Programming Languages
Types of Programming LanguagesTypes of Programming Languages
Types of Programming Languages
 
Pascal Programming Language
Pascal Programming LanguagePascal Programming Language
Pascal Programming Language
 
Programming languages
Programming languagesProgramming languages
Programming languages
 
JAVA PROGRAMMING
JAVA PROGRAMMING JAVA PROGRAMMING
JAVA PROGRAMMING
 
Java basics and java variables
Java basics and java variablesJava basics and java variables
Java basics and java variables
 
Introduction to Programming Languages
Introduction to Programming LanguagesIntroduction to Programming Languages
Introduction to Programming Languages
 
Basics of c++
Basics of c++Basics of c++
Basics of c++
 
Algorithm and flowchart
Algorithm and flowchartAlgorithm and flowchart
Algorithm and flowchart
 
Intro To Programming Concepts
Intro To Programming ConceptsIntro To Programming Concepts
Intro To Programming Concepts
 
Computer Programming
Computer Programming Computer Programming
Computer Programming
 
Looping statements in Java
Looping statements in JavaLooping statements in Java
Looping statements in Java
 

Similar a Theory of programming

Similar a Theory of programming (20)

Sachin kumar ppt on programming in c
Sachin kumar ppt on programming in cSachin kumar ppt on programming in c
Sachin kumar ppt on programming in c
 
Introduction to C Unit 1
Introduction to C Unit 1Introduction to C Unit 1
Introduction to C Unit 1
 
FINAL.ppt
FINAL.pptFINAL.ppt
FINAL.ppt
 
Introduction
IntroductionIntroduction
Introduction
 
C programming presentation(final)
C programming presentation(final)C programming presentation(final)
C programming presentation(final)
 
Chapter 1 Introduction to C .pptx
Chapter 1 Introduction to C .pptxChapter 1 Introduction to C .pptx
Chapter 1 Introduction to C .pptx
 
C language
C languageC language
C language
 
introduction to c programming language
introduction to c programming languageintroduction to c programming language
introduction to c programming language
 
Introduction to programming
Introduction to programmingIntroduction to programming
Introduction to programming
 
What is turbo c and how it works
What is turbo c and how it worksWhat is turbo c and how it works
What is turbo c and how it works
 
00 C hello world.pptx
00 C hello world.pptx00 C hello world.pptx
00 C hello world.pptx
 
C basics
C   basicsC   basics
C basics
 
Chapter 1 - Basic concepts of programming.pdf
Chapter 1 - Basic concepts of programming.pdfChapter 1 - Basic concepts of programming.pdf
Chapter 1 - Basic concepts of programming.pdf
 
Input output statement
Input output statementInput output statement
Input output statement
 
Introduction of c language
Introduction of c languageIntroduction of c language
Introduction of c language
 
Input output in c
Input output in cInput output in c
Input output in c
 
c_pro_introduction.pptx
c_pro_introduction.pptxc_pro_introduction.pptx
c_pro_introduction.pptx
 
Programming in c
Programming in cProgramming in c
Programming in c
 
Fundamental of Information Technology - UNIT 7
Fundamental of Information Technology - UNIT 7Fundamental of Information Technology - UNIT 7
Fundamental of Information Technology - UNIT 7
 
Introduction to c programming language
Introduction to c programming languageIntroduction to c programming language
Introduction to c programming language
 

Más de tcc_joemarie (12)

Mother board
Mother boardMother board
Mother board
 
Financial projections and budgets
Financial projections and budgetsFinancial projections and budgets
Financial projections and budgets
 
Convert Hexadecimal to decimal
Convert Hexadecimal to decimalConvert Hexadecimal to decimal
Convert Hexadecimal to decimal
 
Convert decimal to binary
Convert decimal to binary Convert decimal to binary
Convert decimal to binary
 
Introducing to number system
Introducing to number systemIntroducing to number system
Introducing to number system
 
People media
People media People media
People media
 
Flexible learning environment
Flexible learning environmentFlexible learning environment
Flexible learning environment
 
Digital literacy skills in the 21st century
Digital literacy skills in the 21st centuryDigital literacy skills in the 21st century
Digital literacy skills in the 21st century
 
Online resources, educational sites and portals
Online resources, educational sites and portalsOnline resources, educational sites and portals
Online resources, educational sites and portals
 
The four pillars of education
The four pillars of educationThe four pillars of education
The four pillars of education
 
The concept of algorithm
The concept of algorithmThe concept of algorithm
The concept of algorithm
 
Professional development
Professional developmentProfessional development
Professional development
 

Último

Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
chiefasafspells
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Medical / Health Care (+971588192166) Mifepristone and Misoprostol tablets 200mg
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
masabamasaba
 

Último (20)

WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
WSO2CON 2024 Slides - Open Source to SaaS
WSO2CON 2024 Slides - Open Source to SaaSWSO2CON 2024 Slides - Open Source to SaaS
WSO2CON 2024 Slides - Open Source to SaaS
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
 
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
 
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
 
Artyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxArtyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptx
 
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
 
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
 

Theory of programming

  • 1. COMPUTER PROGRAMMING What is Programming? Programming is a creative process that instructs a computer on how to do a task. Find out more about the different types of programming.
  • 2. WHAT IS A PROGRAMMING LANGUAGE?  Coded language used by programmers to write instructions that a computer can understand to do what the programmer
  • 3. HISTORY OF PROGRAMMING LANGUAGE 1954 - FORTRAN ("Formula Translation“) Hello , World! Source code Output is a general-purpose, imperative programming language that is especially suited to numeric computation and scientific computing.
  • 4. 1970 - Pascal a high-level structured computer programming language used for teaching and general programming. Hello World Source code Output
  • 5. 1983 - C++ Source code Hello World Output is a general-purpose programming language. It has imperative, object-oriented and generic programming features, while also providing facilities for low-level memory manipulation.
  • 6. C - 1978 is a powerful general-purpose programming language. It is fast, portable and available in all platforms. Hello World Source code Output
  • 7. 1991 – Java Source code Hello , World Output a general-purpose computer programming language designed to produce programs that will run on any computer system.
  • 8. THERE ARE THREE MAIN KINDS OF PROGRAMMING LANGUAGE:  Machine language.  Assembly language.  High-level language.
  • 9. C PROGRAMMING LANGUAGE Input output Libraries Header File #include<stdio.h> Functions Printf() Scanf() #include<conio.h> Functions Getch() Textcolor() Textbackground()
  • 10. Main() { //Data types Declaration Type Keyword Boolean = Bool Integer = int Floating point = float Character = char //Variables Declaration Variables are part of almost every program A variable is a “place to put data” and is usually represented by a letter or a word.
  • 11. EXAMPLE 1 – A SIMPLE PAYROLL PROGRAM A Simple Payroll Program Output Name: Basic Pay:Tax : Net Pay: Joemarie 5,000 500 4,500
  • 12. THE CORRESPONDING C PROGRAM #include<stdio.h> #include<conio.h> main() { // Data Types and Variable Declaration char name; int basicpay,tax,netpay; printf("A Simple Payroll Programn"); printf("Name:");scanf("%s",&name); printf(" basicpay :");scanf("%d",&basicpay); printf("Tax:");scanf("%d",&tax); // formula netpay=basicpay-tax; printf("Net Pay: %d",netpay); getch(); }
  • 13. Example 2 – A simple Payroll Program using If Statement A Simple Payroll Program Name: Basic Pay: Tax : Net Pay: Key in Employee's Data Employee's Code: Joemarie a 5,000 500 4,500
  • 14. THE CORRESPONDING C PROGRAM USING IF STATEMENT #include<stdio.h> #include<conio.h> main() { // Data Tpyes and Variable Declaration char name; char empcode; int basicpay,tax,netpay; printf(" A Simple Payroll Programn"); printf(" Key in Employee's Datan"); printf("Name:");scanf("%s",&name); printf("Employee's Code:");scanf("%s",&empcode); if(empcode=='a') basicpay=5000; else if(empcode=='b') basicpay=6000; else if(empcode=='c') basicpay=7000; else if(empcode=='d') basicpay=8000; else if(empcode=='e') basicpay=9000; printf("Basic Pay: %d",basicpay); printf("n"); printf("Tax:");scanf("%d",&tax); // formula netpay=basicpay-tax; printf("Net Pay: %d",netpay); getch(); }
  • 15. LOGICAL ERROR is a mistake in a program's source code that results in incorrect or unexpected behavior. It is a type of runtime error that may simply produce the wrong output or may cause a program to crash while running SYNTAX ERROR A syntax error is an error in the source code of a program.