SlideShare a Scribd company logo
Monolithic and
Procedural Programming
Monolithic Programming
 The Monolithic programming paradigm is the oldest. It has the following
characteristics. It is also known as the imperative programming paradigm.
• In this programming paradigm, the whole program is written in a single block.
• We use the goto statement to jump from one statement to another statement.
• It uses all data as global data which leads to data insecurity.
• There are no flow control statements like if, switch, for, and while statements in
this paradigm.
 An example of a Monolithic programming paradigm is Assembly language.
Procedural Programming
 The procedure-oriented programming paradigm is the advanced paradigm of a
structure-oriented paradigm. It has the following characteristics.
• This paradigm introduces a modular programming concept where a larger program
is divided into smaller modules.
• It provides the concept of code reusability.
• It is introduced with the concept of data types.
• It also provides flow control statements that provide more control to the user.
• It follows all the concepts of structure-oriented programming paradigm but the data
is defined as global data, and also local data to the individual modules.
• In this paradigm, functions may transform data from one form to another.
 Examples of procedure-oriented programming paradigm is C, visual basic,
FORTRAN, etc.
Key Features of Procedural
Programming
 The key features of procedural programming are given below:
• Predefined functions: A predefined function is typically an instruction identified by a name.
Usually, the predefined functions are built into higher-level programming languages, but they
are derived from the library or the registry, rather than the program.
• Local Variable: A local variable is a variable that is declared in the main structure of a method
and is limited to the local scope it is given. The local variable can only be used in the method it
is defined in, and if it were to be used outside the defined method, the code will cease to work.
• Global Variable: A global variable is a variable which is declared outside every other function
defined in the code. Due to this, global variables can be used in all functions, unlike a local
variable.
• Modularity: Modularity is when two dissimilar systems have two different tasks at hand but are
grouped together to conclude a larger task first. Every group of systems then would have its
own tasks finished one after the other until all tasks are complete.
• Parameter Passing: Parameter Passing is a mechanism used to pass parameters to functions,
subroutines or procedures. Parameter Passing can be done through ‘pass by value’, ‘pass by
reference’.
Paradigm Description Main traits
Related
paradigm(s)
Examples
Imperative
Programs
as statements that directly
change
computed state (datafields)
Direct assignments,
common data
structures, global
variables
C, C++, Java, Kotlin,
PHP, Python, Ruby,
Wolfram Language
Procedural
Derived from structured
programming, based on the
concept of modular
programming or
the procedure call
Local variables,
sequence,
selection, iteration,
and modularization
Structured,
imperative
C, C++, Lisp, PHP, P
ython, Wolfram
Language
Examples:
 #include <iostream.h> //procedural programing
 Void fact(int num)
 {int fact=1;
 for (int i = 1; i <= num; i++)
 {
 fact = fact * i;
 }
 cout << "Factorial of " << num << " is: " << fact << endl;
 }
 void main()
 {
 int num;
 cout << "Enter any Number: ";
 cin >> num;
 fact(num);
 }
 #include<iostream.h> //monolithic programing
 void main ()
 {
 int x = 10;
 loop: cout<<x<<",";
 x--;
 if (x>0)
 goto loop;
 }
 #include <iostream> // combine example
 void fact(int num)
 {int fact=1,i=1;
 bin: if( i <= num)
 { fact = fact * i;
 i ++;
 goto bin;
 }
 cout << "Factorial of " << num << " is: " << fact << endl;
 }
 int main()
 {int num;
 cout << "Enter any Number: ";
 cin >> num;
 fact(num);
 }
Ad

More Related Content

What's hot (20)

Hardware Multi-Threading
Hardware Multi-ThreadingHardware Multi-Threading
Hardware Multi-Threading
babuece
 
Principle source of optimazation
Principle source of optimazationPrinciple source of optimazation
Principle source of optimazation
Siva Sathya
 
BLOCK DIAGRAM OF HARDWIRED CONTROL UNIT
BLOCK DIAGRAM OF HARDWIRED CONTROL UNITBLOCK DIAGRAM OF HARDWIRED CONTROL UNIT
BLOCK DIAGRAM OF HARDWIRED CONTROL UNIT
Rahul Sharma
 
MACRO PROCESSOR
MACRO PROCESSORMACRO PROCESSOR
MACRO PROCESSOR
Bhavik Vashi
 
Python Functions
Python   FunctionsPython   Functions
Python Functions
Mohammed Sikander
 
Unit 4 sp macro
Unit 4 sp macroUnit 4 sp macro
Unit 4 sp macro
Deepmala Sharma
 
Python ppt
Python pptPython ppt
Python ppt
Anush verma
 
Subroutines
SubroutinesSubroutines
Subroutines
primeteacher32
 
Unit 2 Principles of Programming Languages
Unit 2 Principles of Programming LanguagesUnit 2 Principles of Programming Languages
Unit 2 Principles of Programming Languages
Vasavi College of Engg
 
Code Optimization
Code OptimizationCode Optimization
Code Optimization
Akhil Kaushik
 
Functions in C
Functions in CFunctions in C
Functions in C
Kamal Acharya
 
Instruction Formats
Instruction FormatsInstruction Formats
Instruction Formats
RaaviKapoor
 
Array Of Pointers
Array Of PointersArray Of Pointers
Array Of Pointers
Sharad Dubey
 
File operations in c
File operations in cFile operations in c
File operations in c
baabtra.com - No. 1 supplier of quality freshers
 
Code generation
Code generationCode generation
Code generation
Aparna Nayak
 
instruction format and addressing modes
instruction format and addressing modesinstruction format and addressing modes
instruction format and addressing modes
RamaPrabha24
 
GE3151_PSPP_All unit _Notes
GE3151_PSPP_All unit _NotesGE3151_PSPP_All unit _Notes
GE3151_PSPP_All unit _Notes
Guru Nanak Technical Institutions
 
C pointer
C pointerC pointer
C pointer
University of Potsdam
 
Modular programming
Modular programmingModular programming
Modular programming
RoshanMaharjan13
 
Unit1 principle of programming language
Unit1 principle of programming languageUnit1 principle of programming language
Unit1 principle of programming language
Vasavi College of Engg
 

Similar to Monolithic and Procedural Programming (20)

Unit 1
Unit  1Unit  1
Unit 1
donny101
 
object oriented programming part inheritance.pptx
object oriented programming part inheritance.pptxobject oriented programming part inheritance.pptx
object oriented programming part inheritance.pptx
urvashipundir04
 
Different paradigms for problem solving.pptx
Different paradigms for problem solving.pptxDifferent paradigms for problem solving.pptx
Different paradigms for problem solving.pptx
iitjeesooraj
 
Plc part 3
Plc  part 3Plc  part 3
Plc part 3
Taymoor Nazmy
 
Prgramming paradigms
Prgramming paradigmsPrgramming paradigms
Prgramming paradigms
Anirudh Chauhan
 
Training 8051Report
Training 8051ReportTraining 8051Report
Training 8051Report
Kuldeep Kaushik
 
Unit 3 principles of programming language
Unit 3 principles of programming languageUnit 3 principles of programming language
Unit 3 principles of programming language
Vasavi College of Engg
 
Coding
CodingCoding
Coding
Anand Mutyala
 
Initial Architectural Design (Game Architecture)
Initial Architectural Design (Game Architecture)Initial Architectural Design (Game Architecture)
Initial Architectural Design (Game Architecture)
Rajkumar Pawar
 
Unit 2
Unit 2Unit 2
Unit 2
R S S RAJU BATTULA
 
Procedural programming
Procedural programmingProcedural programming
Procedural programming
Ankit92Chitnavis
 
Programming language paradigms
Programming language paradigmsProgramming language paradigms
Programming language paradigms
Ashok Raj
 
object oriented programming language in c++
object oriented programming language in c++object oriented programming language in c++
object oriented programming language in c++
Ravikant517175
 
Software engineering topics,coding phase in sdlc
Software engineering topics,coding phase in sdlcSoftware engineering topics,coding phase in sdlc
Software engineering topics,coding phase in sdlc
dhandesumit71
 
Oop.pptx
Oop.pptxOop.pptx
Oop.pptx
KalGetachew2
 
program fundamentals using python1 2 3 4.pptx
program fundamentals using python1 2 3 4.pptxprogram fundamentals using python1 2 3 4.pptx
program fundamentals using python1 2 3 4.pptx
ibrahimsoryjalloh91
 
08 subprograms
08 subprograms08 subprograms
08 subprograms
baran19901990
 
Desired language characteristics – Data typing .pptx
Desired language characteristics – Data typing .pptxDesired language characteristics – Data typing .pptx
Desired language characteristics – Data typing .pptx
4132lenin6497ram
 
Coding
CodingCoding
Coding
Vishal Singh
 
Scope of variables
Scope of variablesScope of variables
Scope of variables
baabtra.com - No. 1 supplier of quality freshers
 
object oriented programming part inheritance.pptx
object oriented programming part inheritance.pptxobject oriented programming part inheritance.pptx
object oriented programming part inheritance.pptx
urvashipundir04
 
Different paradigms for problem solving.pptx
Different paradigms for problem solving.pptxDifferent paradigms for problem solving.pptx
Different paradigms for problem solving.pptx
iitjeesooraj
 
Unit 3 principles of programming language
Unit 3 principles of programming languageUnit 3 principles of programming language
Unit 3 principles of programming language
Vasavi College of Engg
 
Initial Architectural Design (Game Architecture)
Initial Architectural Design (Game Architecture)Initial Architectural Design (Game Architecture)
Initial Architectural Design (Game Architecture)
Rajkumar Pawar
 
Programming language paradigms
Programming language paradigmsProgramming language paradigms
Programming language paradigms
Ashok Raj
 
object oriented programming language in c++
object oriented programming language in c++object oriented programming language in c++
object oriented programming language in c++
Ravikant517175
 
Software engineering topics,coding phase in sdlc
Software engineering topics,coding phase in sdlcSoftware engineering topics,coding phase in sdlc
Software engineering topics,coding phase in sdlc
dhandesumit71
 
program fundamentals using python1 2 3 4.pptx
program fundamentals using python1 2 3 4.pptxprogram fundamentals using python1 2 3 4.pptx
program fundamentals using python1 2 3 4.pptx
ibrahimsoryjalloh91
 
Desired language characteristics – Data typing .pptx
Desired language characteristics – Data typing .pptxDesired language characteristics – Data typing .pptx
Desired language characteristics – Data typing .pptx
4132lenin6497ram
 
Ad

More from Deepam Aggarwal (13)

Frames and its components
Frames and its components Frames and its components
Frames and its components
Deepam Aggarwal
 
Bank managment system
Bank managment systemBank managment system
Bank managment system
Deepam Aggarwal
 
Inventory Management
Inventory Management Inventory Management
Inventory Management
Deepam Aggarwal
 
Dynamic memory allocation and linked lists
Dynamic memory allocation and linked listsDynamic memory allocation and linked lists
Dynamic memory allocation and linked lists
Deepam Aggarwal
 
Group By, Having Clause and Order By clause
Group By, Having Clause and Order By clause Group By, Having Clause and Order By clause
Group By, Having Clause and Order By clause
Deepam Aggarwal
 
Cyber Criminal and Cyber Security
Cyber Criminal and Cyber Security Cyber Criminal and Cyber Security
Cyber Criminal and Cyber Security
Deepam Aggarwal
 
Mdi vb.net
Mdi vb.netMdi vb.net
Mdi vb.net
Deepam Aggarwal
 
Stress Management
Stress Management Stress Management
Stress Management
Deepam Aggarwal
 
Impressionism
ImpressionismImpressionism
Impressionism
Deepam Aggarwal
 
Powersharinginindia 150527161221-lva1-app6892
Powersharinginindia 150527161221-lva1-app6892Powersharinginindia 150527161221-lva1-app6892
Powersharinginindia 150527161221-lva1-app6892
Deepam Aggarwal
 
Triangle and its properties
Triangle and its propertiesTriangle and its properties
Triangle and its properties
Deepam Aggarwal
 
probability-game of chances
probability-game of chancesprobability-game of chances
probability-game of chances
Deepam Aggarwal
 
Political and public awareness through media (B.st)
Political and public awareness through media (B.st)Political and public awareness through media (B.st)
Political and public awareness through media (B.st)
Deepam Aggarwal
 
Frames and its components
Frames and its components Frames and its components
Frames and its components
Deepam Aggarwal
 
Dynamic memory allocation and linked lists
Dynamic memory allocation and linked listsDynamic memory allocation and linked lists
Dynamic memory allocation and linked lists
Deepam Aggarwal
 
Group By, Having Clause and Order By clause
Group By, Having Clause and Order By clause Group By, Having Clause and Order By clause
Group By, Having Clause and Order By clause
Deepam Aggarwal
 
Cyber Criminal and Cyber Security
Cyber Criminal and Cyber Security Cyber Criminal and Cyber Security
Cyber Criminal and Cyber Security
Deepam Aggarwal
 
Powersharinginindia 150527161221-lva1-app6892
Powersharinginindia 150527161221-lva1-app6892Powersharinginindia 150527161221-lva1-app6892
Powersharinginindia 150527161221-lva1-app6892
Deepam Aggarwal
 
Triangle and its properties
Triangle and its propertiesTriangle and its properties
Triangle and its properties
Deepam Aggarwal
 
probability-game of chances
probability-game of chancesprobability-game of chances
probability-game of chances
Deepam Aggarwal
 
Political and public awareness through media (B.st)
Political and public awareness through media (B.st)Political and public awareness through media (B.st)
Political and public awareness through media (B.st)
Deepam Aggarwal
 
Ad

Recently uploaded (20)

Understanding P–N Junction Semiconductors: A Beginner’s Guide
Understanding P–N Junction Semiconductors: A Beginner’s GuideUnderstanding P–N Junction Semiconductors: A Beginner’s Guide
Understanding P–N Junction Semiconductors: A Beginner’s Guide
GS Virdi
 
K12 Tableau Tuesday - Algebra Equity and Access in Atlanta Public Schools
K12 Tableau Tuesday  - Algebra Equity and Access in Atlanta Public SchoolsK12 Tableau Tuesday  - Algebra Equity and Access in Atlanta Public Schools
K12 Tableau Tuesday - Algebra Equity and Access in Atlanta Public Schools
dogden2
 
Introduction to Vibe Coding and Vibe Engineering
Introduction to Vibe Coding and Vibe EngineeringIntroduction to Vibe Coding and Vibe Engineering
Introduction to Vibe Coding and Vibe Engineering
Damian T. Gordon
 
Ultimate VMware 2V0-11.25 Exam Dumps for Exam Success
Ultimate VMware 2V0-11.25 Exam Dumps for Exam SuccessUltimate VMware 2V0-11.25 Exam Dumps for Exam Success
Ultimate VMware 2V0-11.25 Exam Dumps for Exam Success
Mark Soia
 
Handling Multiple Choice Responses: Fortune Effiong.pptx
Handling Multiple Choice Responses: Fortune Effiong.pptxHandling Multiple Choice Responses: Fortune Effiong.pptx
Handling Multiple Choice Responses: Fortune Effiong.pptx
AuthorAIDNationalRes
 
The ever evoilving world of science /7th class science curiosity /samyans aca...
The ever evoilving world of science /7th class science curiosity /samyans aca...The ever evoilving world of science /7th class science curiosity /samyans aca...
The ever evoilving world of science /7th class science curiosity /samyans aca...
Sandeep Swamy
 
How to manage Multiple Warehouses for multiple floors in odoo point of sale
How to manage Multiple Warehouses for multiple floors in odoo point of saleHow to manage Multiple Warehouses for multiple floors in odoo point of sale
How to manage Multiple Warehouses for multiple floors in odoo point of sale
Celine George
 
Social Problem-Unemployment .pptx notes for Physiotherapy Students
Social Problem-Unemployment .pptx notes for Physiotherapy StudentsSocial Problem-Unemployment .pptx notes for Physiotherapy Students
Social Problem-Unemployment .pptx notes for Physiotherapy Students
DrNidhiAgarwal
 
GDGLSPGCOER - Git and GitHub Workshop.pptx
GDGLSPGCOER - Git and GitHub Workshop.pptxGDGLSPGCOER - Git and GitHub Workshop.pptx
GDGLSPGCOER - Git and GitHub Workshop.pptx
azeenhodekar
 
Presentation on Tourism Product Development By Md Shaifullar Rabbi
Presentation on Tourism Product Development By Md Shaifullar RabbiPresentation on Tourism Product Development By Md Shaifullar Rabbi
Presentation on Tourism Product Development By Md Shaifullar Rabbi
Md Shaifullar Rabbi
 
Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...
Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...
Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...
Library Association of Ireland
 
Stein, Hunt, Green letter to Congress April 2025
Stein, Hunt, Green letter to Congress April 2025Stein, Hunt, Green letter to Congress April 2025
Stein, Hunt, Green letter to Congress April 2025
Mebane Rash
 
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Library Association of Ireland
 
New Microsoft PowerPoint Presentation.pptx
New Microsoft PowerPoint Presentation.pptxNew Microsoft PowerPoint Presentation.pptx
New Microsoft PowerPoint Presentation.pptx
milanasargsyan5
 
Presentation of the MIPLM subject matter expert Erdem Kaya
Presentation of the MIPLM subject matter expert Erdem KayaPresentation of the MIPLM subject matter expert Erdem Kaya
Presentation of the MIPLM subject matter expert Erdem Kaya
MIPLM
 
Michelle Rumley & Mairéad Mooney, Boole Library, University College Cork. Tra...
Michelle Rumley & Mairéad Mooney, Boole Library, University College Cork. Tra...Michelle Rumley & Mairéad Mooney, Boole Library, University College Cork. Tra...
Michelle Rumley & Mairéad Mooney, Boole Library, University College Cork. Tra...
Library Association of Ireland
 
How to Manage Opening & Closing Controls in Odoo 17 POS
How to Manage Opening & Closing Controls in Odoo 17 POSHow to Manage Opening & Closing Controls in Odoo 17 POS
How to Manage Opening & Closing Controls in Odoo 17 POS
Celine George
 
Metamorphosis: Life's Transformative Journey
Metamorphosis: Life's Transformative JourneyMetamorphosis: Life's Transformative Journey
Metamorphosis: Life's Transformative Journey
Arshad Shaikh
 
How to Set warnings for invoicing specific customers in odoo
How to Set warnings for invoicing specific customers in odooHow to Set warnings for invoicing specific customers in odoo
How to Set warnings for invoicing specific customers in odoo
Celine George
 
How to Subscribe Newsletter From Odoo 18 Website
How to Subscribe Newsletter From Odoo 18 WebsiteHow to Subscribe Newsletter From Odoo 18 Website
How to Subscribe Newsletter From Odoo 18 Website
Celine George
 
Understanding P–N Junction Semiconductors: A Beginner’s Guide
Understanding P–N Junction Semiconductors: A Beginner’s GuideUnderstanding P–N Junction Semiconductors: A Beginner’s Guide
Understanding P–N Junction Semiconductors: A Beginner’s Guide
GS Virdi
 
K12 Tableau Tuesday - Algebra Equity and Access in Atlanta Public Schools
K12 Tableau Tuesday  - Algebra Equity and Access in Atlanta Public SchoolsK12 Tableau Tuesday  - Algebra Equity and Access in Atlanta Public Schools
K12 Tableau Tuesday - Algebra Equity and Access in Atlanta Public Schools
dogden2
 
Introduction to Vibe Coding and Vibe Engineering
Introduction to Vibe Coding and Vibe EngineeringIntroduction to Vibe Coding and Vibe Engineering
Introduction to Vibe Coding and Vibe Engineering
Damian T. Gordon
 
Ultimate VMware 2V0-11.25 Exam Dumps for Exam Success
Ultimate VMware 2V0-11.25 Exam Dumps for Exam SuccessUltimate VMware 2V0-11.25 Exam Dumps for Exam Success
Ultimate VMware 2V0-11.25 Exam Dumps for Exam Success
Mark Soia
 
Handling Multiple Choice Responses: Fortune Effiong.pptx
Handling Multiple Choice Responses: Fortune Effiong.pptxHandling Multiple Choice Responses: Fortune Effiong.pptx
Handling Multiple Choice Responses: Fortune Effiong.pptx
AuthorAIDNationalRes
 
The ever evoilving world of science /7th class science curiosity /samyans aca...
The ever evoilving world of science /7th class science curiosity /samyans aca...The ever evoilving world of science /7th class science curiosity /samyans aca...
The ever evoilving world of science /7th class science curiosity /samyans aca...
Sandeep Swamy
 
How to manage Multiple Warehouses for multiple floors in odoo point of sale
How to manage Multiple Warehouses for multiple floors in odoo point of saleHow to manage Multiple Warehouses for multiple floors in odoo point of sale
How to manage Multiple Warehouses for multiple floors in odoo point of sale
Celine George
 
Social Problem-Unemployment .pptx notes for Physiotherapy Students
Social Problem-Unemployment .pptx notes for Physiotherapy StudentsSocial Problem-Unemployment .pptx notes for Physiotherapy Students
Social Problem-Unemployment .pptx notes for Physiotherapy Students
DrNidhiAgarwal
 
GDGLSPGCOER - Git and GitHub Workshop.pptx
GDGLSPGCOER - Git and GitHub Workshop.pptxGDGLSPGCOER - Git and GitHub Workshop.pptx
GDGLSPGCOER - Git and GitHub Workshop.pptx
azeenhodekar
 
Presentation on Tourism Product Development By Md Shaifullar Rabbi
Presentation on Tourism Product Development By Md Shaifullar RabbiPresentation on Tourism Product Development By Md Shaifullar Rabbi
Presentation on Tourism Product Development By Md Shaifullar Rabbi
Md Shaifullar Rabbi
 
Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...
Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...
Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...
Library Association of Ireland
 
Stein, Hunt, Green letter to Congress April 2025
Stein, Hunt, Green letter to Congress April 2025Stein, Hunt, Green letter to Congress April 2025
Stein, Hunt, Green letter to Congress April 2025
Mebane Rash
 
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Library Association of Ireland
 
New Microsoft PowerPoint Presentation.pptx
New Microsoft PowerPoint Presentation.pptxNew Microsoft PowerPoint Presentation.pptx
New Microsoft PowerPoint Presentation.pptx
milanasargsyan5
 
Presentation of the MIPLM subject matter expert Erdem Kaya
Presentation of the MIPLM subject matter expert Erdem KayaPresentation of the MIPLM subject matter expert Erdem Kaya
Presentation of the MIPLM subject matter expert Erdem Kaya
MIPLM
 
Michelle Rumley & Mairéad Mooney, Boole Library, University College Cork. Tra...
Michelle Rumley & Mairéad Mooney, Boole Library, University College Cork. Tra...Michelle Rumley & Mairéad Mooney, Boole Library, University College Cork. Tra...
Michelle Rumley & Mairéad Mooney, Boole Library, University College Cork. Tra...
Library Association of Ireland
 
How to Manage Opening & Closing Controls in Odoo 17 POS
How to Manage Opening & Closing Controls in Odoo 17 POSHow to Manage Opening & Closing Controls in Odoo 17 POS
How to Manage Opening & Closing Controls in Odoo 17 POS
Celine George
 
Metamorphosis: Life's Transformative Journey
Metamorphosis: Life's Transformative JourneyMetamorphosis: Life's Transformative Journey
Metamorphosis: Life's Transformative Journey
Arshad Shaikh
 
How to Set warnings for invoicing specific customers in odoo
How to Set warnings for invoicing specific customers in odooHow to Set warnings for invoicing specific customers in odoo
How to Set warnings for invoicing specific customers in odoo
Celine George
 
How to Subscribe Newsletter From Odoo 18 Website
How to Subscribe Newsletter From Odoo 18 WebsiteHow to Subscribe Newsletter From Odoo 18 Website
How to Subscribe Newsletter From Odoo 18 Website
Celine George
 

Monolithic and Procedural Programming

  • 2. Monolithic Programming  The Monolithic programming paradigm is the oldest. It has the following characteristics. It is also known as the imperative programming paradigm. • In this programming paradigm, the whole program is written in a single block. • We use the goto statement to jump from one statement to another statement. • It uses all data as global data which leads to data insecurity. • There are no flow control statements like if, switch, for, and while statements in this paradigm.  An example of a Monolithic programming paradigm is Assembly language.
  • 3. Procedural Programming  The procedure-oriented programming paradigm is the advanced paradigm of a structure-oriented paradigm. It has the following characteristics. • This paradigm introduces a modular programming concept where a larger program is divided into smaller modules. • It provides the concept of code reusability. • It is introduced with the concept of data types. • It also provides flow control statements that provide more control to the user. • It follows all the concepts of structure-oriented programming paradigm but the data is defined as global data, and also local data to the individual modules. • In this paradigm, functions may transform data from one form to another.  Examples of procedure-oriented programming paradigm is C, visual basic, FORTRAN, etc.
  • 4. Key Features of Procedural Programming  The key features of procedural programming are given below: • Predefined functions: A predefined function is typically an instruction identified by a name. Usually, the predefined functions are built into higher-level programming languages, but they are derived from the library or the registry, rather than the program. • Local Variable: A local variable is a variable that is declared in the main structure of a method and is limited to the local scope it is given. The local variable can only be used in the method it is defined in, and if it were to be used outside the defined method, the code will cease to work. • Global Variable: A global variable is a variable which is declared outside every other function defined in the code. Due to this, global variables can be used in all functions, unlike a local variable. • Modularity: Modularity is when two dissimilar systems have two different tasks at hand but are grouped together to conclude a larger task first. Every group of systems then would have its own tasks finished one after the other until all tasks are complete. • Parameter Passing: Parameter Passing is a mechanism used to pass parameters to functions, subroutines or procedures. Parameter Passing can be done through ‘pass by value’, ‘pass by reference’.
  • 5. Paradigm Description Main traits Related paradigm(s) Examples Imperative Programs as statements that directly change computed state (datafields) Direct assignments, common data structures, global variables C, C++, Java, Kotlin, PHP, Python, Ruby, Wolfram Language Procedural Derived from structured programming, based on the concept of modular programming or the procedure call Local variables, sequence, selection, iteration, and modularization Structured, imperative C, C++, Lisp, PHP, P ython, Wolfram Language
  • 6. Examples:  #include <iostream.h> //procedural programing  Void fact(int num)  {int fact=1;  for (int i = 1; i <= num; i++)  {  fact = fact * i;  }  cout << "Factorial of " << num << " is: " << fact << endl;  }  void main()  {  int num;  cout << "Enter any Number: ";  cin >> num;  fact(num);  }
  • 7.  #include<iostream.h> //monolithic programing  void main ()  {  int x = 10;  loop: cout<<x<<",";  x--;  if (x>0)  goto loop;  }  #include <iostream> // combine example  void fact(int num)  {int fact=1,i=1;  bin: if( i <= num)  { fact = fact * i;  i ++;  goto bin;  }  cout << "Factorial of " << num << " is: " << fact << endl;  }  int main()  {int num;  cout << "Enter any Number: ";  cin >> num;  fact(num);  }