SlideShare una empresa de 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

Más contenido relacionado

La actualidad más candente

La actualidad más candente (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
 

Similar 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
 

Similar 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

Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
negromaestrong
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
kauryashika82
 
An Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdfAn Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdf
SanaAli374401
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
QucHHunhnh
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
QucHHunhnh
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
ciinovamais
 
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)

Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).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.
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
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
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
An Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdfAn Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdf
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 

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.