SlideShare uma empresa Scribd logo
1 de 10
PROCEDURAL
PROGRAMMING

Ankit S. Chitnavis
Introduction :Procedural programming is the standard approach used in traditional
computer language such as C, Pascal, FORTRAN & BASIC.
The basic idea is to have a program specify the sequence of steps that
implements a particular algorithm .
Procedural programming is a term used to denote the way in which a
computer programmer writes a program.
This method of developing software, which also is called an application,
revolves around keeping code as concise as possible. It also focuses on a
very specific end result to be achieved.
Procedural programming creates a step by step program that guides the
application through a sequence of instructions. Each instruction is
executed in order.

Procedural programming focuses on processes. In procedural
programming data and functions are stored in separate memory location,
while in OOP data and functions are stored in same memory location.

Programs are made up of modules, which are parts of a
program that can be coded and tested separately, and then assembled to
form a complete program.
In procedural languages (i.e. C) these modules are procedures, where a
procedure is a sequence of statements.
In C for example, procedures are a sequence of imperative statements, such as
assignments, tests, loops and invocations of sub procedures. These procedures
are functions, which map arguments to return statements.
The design method used in procedural programming is called
Top Down Design.
This is where you start with a problem (procedure) and then
systematically break the problem down into sub problems (sub
procedures).
This is called functional decomposition, which continues until a sub
problem is straightforward enough to be solved by the corresponding sub
procedure.

When changes are made to the main procedure (top), those changes can
cascade to the sub procedures of main, and the sub-sub procedures and
so on, where the change may impact all procedures in the pyramid.
The problem with PP approach is its handling of data. PP approach gives
no importance to data. By ‘data’ we mean the information collected from
user, the new results obtained after calculations etc.
In C, a data member must be declared GLOBAL inorder to make it accessible
by 2 or more functions in the program.
What happens when 2 or more functions work on the same data member ?
If there are 10 functions in a program, all these 10 functions can access a
global data member. It is possible one function may accidentally change
values of this global data member.
If this data member is a key element of the program, any such accidental
manipulation will affect the whole program. It will be too difficult to debug &
identify which function is causing the problem if the program is really big.
Fibonacci series program in c using recursion

#include<stdio.h>
int Fibonacci(int);
main()
{
int n, i = 0, c;
printf("Enter the number of
termsn");
scanf("%d",&n);
printf("Fibonacci seriesn");
for ( c = 1 ; c <= n ; c++ )
{
printf("%dn", Fibonacci(i));
i++;
}
return 0;
}

int Fibonacci(int n)
{ if ( n == 0 )
return 0;
else
if ( n == 1 )
return 1;
else
return ( Fibonacci(n-1) +Fibonacci(n-2));
}
System Software

Applications
Advantages of Procedural Programming:
Its relative simplicity, and ease of implementation of compilers and
interpreters.
The ability to re-use the same code at different places in the program without
copying it.
An easier way to keep track of program flow.
 The ability to be strongly modular or structured.
Needs only less memory.
Disadvantages of Procedural Programming:
Data is exposed to whole program, so no security for data.
Difficult to relate with real world objects.
Difficult to create new data types reduces extensibility.
Importance is given to the operation on data rather than the data.
Thank
You

Mais conteúdo relacionado

Mais procurados

Mais procurados (20)

Introduction to programming
Introduction to programmingIntroduction to programming
Introduction to programming
 
Introduction to c++ ppt 1
Introduction to c++ ppt 1Introduction to c++ ppt 1
Introduction to c++ ppt 1
 
Introduction to Object Oriented Programming
Introduction to Object Oriented ProgrammingIntroduction to Object Oriented Programming
Introduction to Object Oriented Programming
 
Presentation on Function in C Programming
Presentation on Function in C ProgrammingPresentation on Function in C Programming
Presentation on Function in C Programming
 
oops concept in java | object oriented programming in java
oops concept in java | object oriented programming in javaoops concept in java | object oriented programming in java
oops concept in java | object oriented programming in java
 
Object Oriented Programming Lecture Notes
Object Oriented Programming Lecture NotesObject Oriented Programming Lecture Notes
Object Oriented Programming Lecture Notes
 
Procedure oriented programming
Procedure oriented programmingProcedure oriented programming
Procedure oriented programming
 
Object oriented programming c++
Object oriented programming c++Object oriented programming c++
Object oriented programming c++
 
Loops c++
Loops c++Loops c++
Loops c++
 
Programming Paradigms
Programming ParadigmsProgramming Paradigms
Programming Paradigms
 
C++ How to program
C++ How to programC++ How to program
C++ How to program
 
Functions in C
Functions in CFunctions in C
Functions in C
 
Basic concept of OOP's
Basic concept of OOP'sBasic concept of OOP's
Basic concept of OOP's
 
RECURSION IN C
RECURSION IN C RECURSION IN C
RECURSION IN C
 
Introduction to problem solving in C
Introduction to problem solving in CIntroduction to problem solving in C
Introduction to problem solving in C
 
Functions in c
Functions in cFunctions in c
Functions in c
 
Compiler vs interpreter
Compiler vs interpreterCompiler vs interpreter
Compiler vs interpreter
 
Programming Fundamentals
Programming FundamentalsProgramming Fundamentals
Programming Fundamentals
 
Object-Oriented Paradigm
Object-Oriented Paradigm Object-Oriented Paradigm
Object-Oriented Paradigm
 
C++ Overview PPT
C++ Overview PPTC++ Overview PPT
C++ Overview PPT
 

Semelhante a Procedural programming

Overview of c++
Overview of c++Overview of c++
Overview of c++
geeeeeet
 
Problem Solving Techniques
Problem Solving TechniquesProblem Solving Techniques
Problem Solving Techniques
Ashesh R
 

Semelhante a Procedural programming (20)

program development and paradigms
program development and paradigmsprogram development and paradigms
program development and paradigms
 
Book management system
Book management systemBook management system
Book management system
 
Overview of c++
Overview of c++Overview of c++
Overview of c++
 
Stnotes doc 5
Stnotes doc 5Stnotes doc 5
Stnotes doc 5
 
PROBLEM SOLVING
PROBLEM SOLVINGPROBLEM SOLVING
PROBLEM SOLVING
 
Scope of variables
Scope of variablesScope of variables
Scope of variables
 
Scope of variables
Scope of variablesScope of variables
Scope of variables
 
Programming_Lecture_1.pptx
Programming_Lecture_1.pptxProgramming_Lecture_1.pptx
Programming_Lecture_1.pptx
 
Problem Solving Techniques
Problem Solving TechniquesProblem Solving Techniques
Problem Solving Techniques
 
What is algorithm
What is algorithmWhat is algorithm
What is algorithm
 
Unit 1 python (2021 r)
Unit 1 python (2021 r)Unit 1 python (2021 r)
Unit 1 python (2021 r)
 
lecture 5
 lecture 5 lecture 5
lecture 5
 
Introduction to computer science
Introduction to computer scienceIntroduction to computer science
Introduction to computer science
 
PCCF UNIT 1.pptx
PCCF UNIT 1.pptxPCCF UNIT 1.pptx
PCCF UNIT 1.pptx
 
PDLC.pptx
PDLC.pptxPDLC.pptx
PDLC.pptx
 
Training 8051Report
Training 8051ReportTraining 8051Report
Training 8051Report
 
Scope of variables
Scope of variablesScope of variables
Scope of variables
 
Software maintenance
Software maintenanceSoftware maintenance
Software maintenance
 
Vedic Calculator
Vedic CalculatorVedic Calculator
Vedic Calculator
 
Programming in c++
Programming in c++Programming in c++
Programming in c++
 

Último

Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
PECB
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
Chris Hunter
 

Último (20)

SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writing
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 

Procedural programming

  • 2. Introduction :Procedural programming is the standard approach used in traditional computer language such as C, Pascal, FORTRAN & BASIC. The basic idea is to have a program specify the sequence of steps that implements a particular algorithm . Procedural programming is a term used to denote the way in which a computer programmer writes a program. This method of developing software, which also is called an application, revolves around keeping code as concise as possible. It also focuses on a very specific end result to be achieved.
  • 3. Procedural programming creates a step by step program that guides the application through a sequence of instructions. Each instruction is executed in order. Procedural programming focuses on processes. In procedural programming data and functions are stored in separate memory location, while in OOP data and functions are stored in same memory location. Programs are made up of modules, which are parts of a program that can be coded and tested separately, and then assembled to form a complete program.
  • 4. In procedural languages (i.e. C) these modules are procedures, where a procedure is a sequence of statements. In C for example, procedures are a sequence of imperative statements, such as assignments, tests, loops and invocations of sub procedures. These procedures are functions, which map arguments to return statements.
  • 5. The design method used in procedural programming is called Top Down Design. This is where you start with a problem (procedure) and then systematically break the problem down into sub problems (sub procedures). This is called functional decomposition, which continues until a sub problem is straightforward enough to be solved by the corresponding sub procedure. When changes are made to the main procedure (top), those changes can cascade to the sub procedures of main, and the sub-sub procedures and so on, where the change may impact all procedures in the pyramid. The problem with PP approach is its handling of data. PP approach gives no importance to data. By ‘data’ we mean the information collected from user, the new results obtained after calculations etc.
  • 6. In C, a data member must be declared GLOBAL inorder to make it accessible by 2 or more functions in the program. What happens when 2 or more functions work on the same data member ? If there are 10 functions in a program, all these 10 functions can access a global data member. It is possible one function may accidentally change values of this global data member. If this data member is a key element of the program, any such accidental manipulation will affect the whole program. It will be too difficult to debug & identify which function is causing the problem if the program is really big.
  • 7. Fibonacci series program in c using recursion #include<stdio.h> int Fibonacci(int); main() { int n, i = 0, c; printf("Enter the number of termsn"); scanf("%d",&n); printf("Fibonacci seriesn"); for ( c = 1 ; c <= n ; c++ ) { printf("%dn", Fibonacci(i)); i++; } return 0; } int Fibonacci(int n) { if ( n == 0 ) return 0; else if ( n == 1 ) return 1; else return ( Fibonacci(n-1) +Fibonacci(n-2)); }
  • 9. Advantages of Procedural Programming: Its relative simplicity, and ease of implementation of compilers and interpreters. The ability to re-use the same code at different places in the program without copying it. An easier way to keep track of program flow.  The ability to be strongly modular or structured. Needs only less memory. Disadvantages of Procedural Programming: Data is exposed to whole program, so no security for data. Difficult to relate with real world objects. Difficult to create new data types reduces extensibility. Importance is given to the operation on data rather than the data.