SlideShare a Scribd company logo
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

More Related Content

What's hot

Algorithm and flowchart
Algorithm and flowchartAlgorithm and flowchart
Algorithm and flowchart
Rabin BK
 
Character set of c
Character set of cCharacter set of c
Character set of c
Chandrapriya Rediex
 
Programming Fundamentals lecture 1
Programming Fundamentals lecture 1Programming Fundamentals lecture 1
Programming Fundamentals lecture 1
REHAN IJAZ
 
Introduction to computer programming
Introduction to computer programmingIntroduction to computer programming
Introduction to computer programmingNSU-Biliran Campus
 
Programming
ProgrammingProgramming
Programming
Leo Simon Anfone
 
Intro To Programming Concepts
Intro To Programming ConceptsIntro To Programming Concepts
Intro To Programming ConceptsJussi Pohjolainen
 
Chapter 1 - An Introduction to Programming
Chapter 1 - An Introduction to ProgrammingChapter 1 - An Introduction to Programming
Chapter 1 - An Introduction to Programming
mshellman
 
Language processor
Language processorLanguage processor
Language processorAbha Damani
 
Programming Languages An Intro
Programming Languages An IntroProgramming Languages An Intro
Programming Languages An IntroKimberly De Guzman
 
Programming Fundamentals lecture 2
Programming Fundamentals lecture 2Programming Fundamentals lecture 2
Programming Fundamentals lecture 2
REHAN IJAZ
 
Fundamentals of Programming Chapter 2
Fundamentals of Programming Chapter 2Fundamentals of Programming Chapter 2
Fundamentals of Programming Chapter 2
Mohd Harris Ahmad Jaal
 
Programming languages
Programming languagesProgramming languages
Programming languages
Simon Mui
 
Programming Fundamentals
Programming FundamentalsProgramming Fundamentals
Programming Fundamentals
Trivuz ত্রিভুজ
 
structured programming
structured programmingstructured programming
structured programming
Ahmad54321
 
Introduction to Computer Programming
Introduction to Computer ProgrammingIntroduction to Computer Programming
Computer Organization and Assembly Language
Computer Organization and Assembly LanguageComputer Organization and Assembly Language
Computer Organization and Assembly Language
fasihuddin90
 
Types of Programming Languages
Types of Programming LanguagesTypes of Programming Languages
Types of Programming Languages
Juhi Bhoyar
 

What's hot (20)

Algorithm and flowchart
Algorithm and flowchartAlgorithm and flowchart
Algorithm and flowchart
 
Character set of c
Character set of cCharacter set of c
Character set of c
 
Programming Fundamentals lecture 1
Programming Fundamentals lecture 1Programming Fundamentals lecture 1
Programming Fundamentals lecture 1
 
Introduction to computer programming
Introduction to computer programmingIntroduction to computer programming
Introduction to computer programming
 
Programming
ProgrammingProgramming
Programming
 
Intro To Programming Concepts
Intro To Programming ConceptsIntro To Programming Concepts
Intro To Programming Concepts
 
Chapter 1 - An Introduction to Programming
Chapter 1 - An Introduction to ProgrammingChapter 1 - An Introduction to Programming
Chapter 1 - An Introduction to Programming
 
Computer Programming - Lecture 1
Computer Programming - Lecture 1Computer Programming - Lecture 1
Computer Programming - Lecture 1
 
Language processor
Language processorLanguage processor
Language processor
 
Chapter 5
Chapter 5Chapter 5
Chapter 5
 
Algorithm and flowchart
Algorithm and flowchartAlgorithm and flowchart
Algorithm and flowchart
 
Programming Languages An Intro
Programming Languages An IntroProgramming Languages An Intro
Programming Languages An Intro
 
Programming Fundamentals lecture 2
Programming Fundamentals lecture 2Programming Fundamentals lecture 2
Programming Fundamentals lecture 2
 
Fundamentals of Programming Chapter 2
Fundamentals of Programming Chapter 2Fundamentals of Programming Chapter 2
Fundamentals of Programming Chapter 2
 
Programming languages
Programming languagesProgramming languages
Programming languages
 
Programming Fundamentals
Programming FundamentalsProgramming Fundamentals
Programming Fundamentals
 
structured programming
structured programmingstructured programming
structured programming
 
Introduction to Computer Programming
Introduction to Computer ProgrammingIntroduction to Computer Programming
Introduction to Computer Programming
 
Computer Organization and Assembly Language
Computer Organization and Assembly LanguageComputer Organization and Assembly Language
Computer Organization and Assembly Language
 
Types of Programming Languages
Types of Programming LanguagesTypes of Programming Languages
Types of Programming Languages
 

Similar to Theory of programming

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
Sachin Kumar
 
Introduction to C Unit 1
Introduction to C Unit 1Introduction to C Unit 1
Introduction to C Unit 1
SURBHI SAROHA
 
FINAL.ppt
FINAL.pptFINAL.ppt
FINAL.ppt
DeveshKatiyar5
 
Introduction
IntroductionIntroduction
Introduction
Kamran
 
C programming presentation(final)
C programming presentation(final)C programming presentation(final)
C programming presentation(final)
aaravSingh41
 
Chapter 1 Introduction to C .pptx
Chapter 1 Introduction to C .pptxChapter 1 Introduction to C .pptx
Chapter 1 Introduction to C .pptx
Abdalla536859
 
C language
C languageC language
C language
marar hina
 
introduction to c programming language
introduction to c programming languageintroduction to c programming language
introduction to c programming language
sanjay joshi
 
Introduction to programming
Introduction to programmingIntroduction to programming
Introduction to programming
Neeru Mittal
 
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
Mark John Lado, MIT
 
00 C hello world.pptx
00 C hello world.pptx00 C hello world.pptx
00 C hello world.pptx
Carla227537
 
C basics
C   basicsC   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
KirubelWondwoson1
 
Input output statement
Input output statementInput output statement
Input output statement
sunilchute1
 
Introduction of c language
Introduction of c languageIntroduction of c language
Introduction of c language
farishah
 
Input output in c
Input output in cInput output in c
Input output in c
Ducat
 
c_pro_introduction.pptx
c_pro_introduction.pptxc_pro_introduction.pptx
c_pro_introduction.pptx
RohitRaj744272
 
Programming in c
Programming in cProgramming in c
Programming in c
Ashutosh Srivasatava
 
Fundamental of Information Technology - UNIT 7
Fundamental of Information Technology - UNIT 7Fundamental of Information Technology - UNIT 7
Fundamental of Information Technology - UNIT 7
Shipra Swati
 
Introduction to c programming language
Introduction to c programming languageIntroduction to c programming language
Introduction to c programming language
sanjay joshi
 

Similar to 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
 

More from tcc_joemarie

Mother board
Mother boardMother board
Mother board
tcc_joemarie
 
Financial projections and budgets
Financial projections and budgetsFinancial projections and budgets
Financial projections and budgets
tcc_joemarie
 
Convert Hexadecimal to decimal
Convert Hexadecimal to decimalConvert Hexadecimal to decimal
Convert Hexadecimal to decimal
tcc_joemarie
 
Convert decimal to binary
Convert decimal to binary Convert decimal to binary
Convert decimal to binary
tcc_joemarie
 
Introducing to number system
Introducing to number systemIntroducing to number system
Introducing to number system
tcc_joemarie
 
People media
People media People media
People media
tcc_joemarie
 
Flexible learning environment
Flexible learning environmentFlexible learning environment
Flexible learning environment
tcc_joemarie
 
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
tcc_joemarie
 
Online resources, educational sites and portals
Online resources, educational sites and portalsOnline resources, educational sites and portals
Online resources, educational sites and portals
tcc_joemarie
 
The four pillars of education
The four pillars of educationThe four pillars of education
The four pillars of education
tcc_joemarie
 
The concept of algorithm
The concept of algorithmThe concept of algorithm
The concept of algorithm
tcc_joemarie
 
Professional development
Professional developmentProfessional development
Professional development
tcc_joemarie
 

More from 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
 

Recently uploaded

Lecture 1 Introduction to games development
Lecture 1 Introduction to games developmentLecture 1 Introduction to games development
Lecture 1 Introduction to games development
abdulrafaychaudhry
 
Why React Native as a Strategic Advantage for Startup Innovation.pdf
Why React Native as a Strategic Advantage for Startup Innovation.pdfWhy React Native as a Strategic Advantage for Startup Innovation.pdf
Why React Native as a Strategic Advantage for Startup Innovation.pdf
ayushiqss
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
Max Andersen
 
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus
 
How to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good PracticesHow to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good Practices
Globus
 
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.ILBeyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Natan Silnitsky
 
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Anthony Dahanne
 
How Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptxHow Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptx
wottaspaceseo
 
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume MontevideoVitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke
 
2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx
Georgi Kodinov
 
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Globus
 
Software Testing Exam imp Ques Notes.pdf
Software Testing Exam imp Ques Notes.pdfSoftware Testing Exam imp Ques Notes.pdf
Software Testing Exam imp Ques Notes.pdf
MayankTawar1
 
Into the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdfInto the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdf
Ortus Solutions, Corp
 
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
Juraj Vysvader
 
Understanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSageUnderstanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSage
Globus
 
Explore Modern SharePoint Templates for 2024
Explore Modern SharePoint Templates for 2024Explore Modern SharePoint Templates for 2024
Explore Modern SharePoint Templates for 2024
Sharepoint Designs
 
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamOpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
takuyayamamoto1800
 
Strategies for Successful Data Migration Tools.pptx
Strategies for Successful Data Migration Tools.pptxStrategies for Successful Data Migration Tools.pptx
Strategies for Successful Data Migration Tools.pptx
varshanayak241
 
Visitor Management System in India- Vizman.app
Visitor Management System in India- Vizman.appVisitor Management System in India- Vizman.app
Visitor Management System in India- Vizman.app
NaapbooksPrivateLimi
 
Advanced Flow Concepts Every Developer Should Know
Advanced Flow Concepts Every Developer Should KnowAdvanced Flow Concepts Every Developer Should Know
Advanced Flow Concepts Every Developer Should Know
Peter Caitens
 

Recently uploaded (20)

Lecture 1 Introduction to games development
Lecture 1 Introduction to games developmentLecture 1 Introduction to games development
Lecture 1 Introduction to games development
 
Why React Native as a Strategic Advantage for Startup Innovation.pdf
Why React Native as a Strategic Advantage for Startup Innovation.pdfWhy React Native as a Strategic Advantage for Startup Innovation.pdf
Why React Native as a Strategic Advantage for Startup Innovation.pdf
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
 
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
 
How to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good PracticesHow to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good Practices
 
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.ILBeyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
 
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
 
How Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptxHow Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptx
 
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume MontevideoVitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume Montevideo
 
2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx
 
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
 
Software Testing Exam imp Ques Notes.pdf
Software Testing Exam imp Ques Notes.pdfSoftware Testing Exam imp Ques Notes.pdf
Software Testing Exam imp Ques Notes.pdf
 
Into the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdfInto the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdf
 
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
 
Understanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSageUnderstanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSage
 
Explore Modern SharePoint Templates for 2024
Explore Modern SharePoint Templates for 2024Explore Modern SharePoint Templates for 2024
Explore Modern SharePoint Templates for 2024
 
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamOpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
 
Strategies for Successful Data Migration Tools.pptx
Strategies for Successful Data Migration Tools.pptxStrategies for Successful Data Migration Tools.pptx
Strategies for Successful Data Migration Tools.pptx
 
Visitor Management System in India- Vizman.app
Visitor Management System in India- Vizman.appVisitor Management System in India- Vizman.app
Visitor Management System in India- Vizman.app
 
Advanced Flow Concepts Every Developer Should Know
Advanced Flow Concepts Every Developer Should KnowAdvanced Flow Concepts Every Developer Should Know
Advanced Flow Concepts Every Developer Should Know
 

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.