SlideShare a Scribd company logo
1 of 19
‘C’ LANGUAGE EXECUTION STEP’S
& ALGORITHM
PRESENTED BY-
KUNAL K. PANDHRAM
1
ElectrohybridTech
EXECUTION OF A PROGRAM
electrohybridTech 2
EXECUTION OF A PROGRAM
(CONTD…)
• Assembler
1. Self Assembler 2. Cross Assembler
1. One-Pass 2. Two-Pass
• Compiler
1. Self Compiler 2. Cross Compiler
• Linker
• Interpreter
• Loader
electrohybridTech 3
ASSEMBLER
• Computer understand machine language.
• Other language must be translated.
• This translation is done with the help of software
(Assembler).
• Types :
• Self ( Resident )
If an assembler which runs on a computer and
produces the machine codes for the same computer
then it is called self assembler or resident assembler.
• Cross
If an assembler that runs on a computer and
produces the machine codes for other computer then it iselectrohybridTech
4
• Types
• One pass
One pass assembler is the assembler which assigns the
memory addresses to the variables and translates the source
code into machine code in the first pass simultaneously.
• Two pass
-A Two Pass Assembler is the assembler which
reads the source code twice.
-In the first pass, it reads all the variables
and assigns them memory addresses.
-In the second pass, it reads the source
code and
translates the code into object code.electrohybridTech
5
COMPILER
• High level lang. to Machine level lang.
• low speed (but faster than interpreter) and more
memory
• Types
• Self ( Resident)
• If a compiler runs on a computer and produces the machine
codes for the same computer then it is known as a self
compiler or resident compiler.
• Cross
• if a compiler runs on a computer and produces the
machine codes for other computer then it is known as a
cross compiler.electrohybridTech 6
INTERPRETER
• Translates statements of a program into
machine code.
• It translates only one statement of the
program at a time.
• A compiler is faster than an interpreter.
• Small program as compared to compiler
• Less memory
electrohybridTech 7
electrohybridTech 8
LINKER
• Header files which contain functions to be executed.
• These functions are linked to the libraries by a
program called Linker.
• If no linking, informs compiler and compiler generates
error.
• The compiler automatically invokes the linker as the
last step in compiling a program.
• If large prog., divides into subprog.(modules) and these
modules are combined to execute.
• The process of combining the modules is done by the
linker.electrohybridTech 9
LOADER
• Loader is a program that loads machine codes of
a program into the system memory.
• It is one of the essential stages in the process
of starting a program.
• Loading a program involves reading the contents
of executable file into memory.
• Once loading is complete, the operating system
starts the program by passing control to the
loaded program code.
electrohybridTech 10
ALGORITHMS
• A SEQUENTIAL SOLUTION OF ANY PROGRAM THAT WRITTEN IN
HUMAN LANGUAGE, CALLED ALGORITHM.
• ALGORITHM IS FIRST STEP OF THE SOLUTION PROCESS, AFTER THE
ANALYSIS OF PROBLEM, PROGRAMMER WRITE THE ALGORITHM OF
THAT PROBLEM.
electrohybridTech 11
PROPERTIES OF THE ALGORITHM
1) Finiteness: - an algorithm terminates after a finite numbers of
steps.
2) Definiteness: - each step in algorithm is unambiguous. This
means that the action specified by the step cannot be interpreted
(explain the meaning of) in multiple ways & can be performed
without any confusion.
3) Input:- an algorithm accepts zero or more inputs
4) Output:- it produces at least one output.
5) Effectiveness:- it consists of basic instructions that are realizable.
This means that the instructions can be performed by using the
given inputs in a finite amount of time.electrohybridTech 12
FLOWCHART
• Graphical representation of any program is called
flowchart.
• The flowchart is a means of visually presenting the
flow of data, the operations performed and the
sequence in which they are performed to solve a
problem.
• Flowcharts are generally drawn in the early stages of
formulating computer solutions. These flowcharts play
a vital role in the programming of a problem and are
quite helpful in understanding the logic of complicated
and lengthy problems. Once the flowchart is drawn, it
becomes easy to write the program in any high level
language. Flowcharts are helpful in explaining theelectrohybridTech
13
FLOW CHART SYMBOLS
Oval Terminal
Parallegram Input/output
Rectangle Process
Document Hard copy
Diamond Decision
Circle Connector
Double sided Rectangle Sub program
Hexagon Iteration
Trapezoid Manual Operation
Cylinder Magnetic Disk Storage
electrohybridTech
14
ADVANTAGES OF USING
FLOWCHART
• Communication: Flowcharts are better way of
communicating the logic of a system to all concerned.
• Effective analysis: With the help of flowchart,
problem can be analyzed in more effective way.
• Proper documentation: Program flowcharts serve as
a good program documentation, which is needed for
various purposes.
• Efficient Coding: The flowcharts act as a guide or
blueprint during the systems analysis and program
development phase.
• Proper Debugging: The flowchart helps in
debugging process.
electrohybridTech
15
LIMITATIONS OF USING
FLOWCHARTS
• Complex logic: Sometimes, the program logic
is quite complicated. In that case, flowchart
becomes complex and clumsy.
• Alterations and Modifications: If alterations
are required the flowchart may require re
drawing completely.
electrohybridTech 16
PSEUDOCODE
• Pseudocode is an informal high-level description of
the operating principle of a computer program or
other algorithm.
• Pseudocode typically omits details that are not
essential for human understanding of the
algorithm.
• The purpose of using pseudocode is that it is
easier for people to understand than conventional
programming language code.
electrohybridTech 17
Algorithm: Step by step procedure of solving a particular problem.
Pseudo code: Artificial informal language used to develop algorithms.
Flow chart: Graphical representation of an algorithm.
Algorithm to find whether a number even or odd:
Step1: Begin Step1: START
Step2: Take a number Step2: Read num
Step3: if the number is divisible by2 then Step3: if(num%2=0) then
print that number is even print num is even
otherwise print that number is odd otherwise
print num is odd
Step4: End Step4: STOP
(Algorithm in natural language) (Algorithm by using pseudo code)
#include<stdio.h>
#include<conio.h>
main()
{
int num;
printf(“Enter any number”);
scanf(“%d”,&num);
if(num%2==0)
printf(“%d is even”,num);
else
printf(%d is odd”,num);
}
(Program in C language)
start
read
num
print
num is
even
stop
If
num%2
=0
print
num is
odd
Flow
chart:
Yes No
electrohybridTech
18
electrohybridTech 19
Thank You !
For more details –
Linkedin/kunalpandhram/sli
deshare

More Related Content

What's hot (20)

Algorithmic problem sloving
Algorithmic problem slovingAlgorithmic problem sloving
Algorithmic problem sloving
 
Debuggers in system software
Debuggers in system softwareDebuggers in system software
Debuggers in system software
 
Logic Formulation 1
Logic Formulation 1Logic Formulation 1
Logic Formulation 1
 
4. processor
4. processor4. processor
4. processor
 
Compiler lecture 03
Compiler lecture 03Compiler lecture 03
Compiler lecture 03
 
Program logic formulation
Program logic formulationProgram logic formulation
Program logic formulation
 
Compiler Construction
Compiler ConstructionCompiler Construction
Compiler Construction
 
Interpreters & Debuggers
Interpreters  &  DebuggersInterpreters  &  Debuggers
Interpreters & Debuggers
 
Language processor
Language processorLanguage processor
Language processor
 
Compiler Design Basics
Compiler Design BasicsCompiler Design Basics
Compiler Design Basics
 
Lecture1 introduction compilers
Lecture1 introduction compilersLecture1 introduction compilers
Lecture1 introduction compilers
 
Compilers
CompilersCompilers
Compilers
 
Compiler construction tools
Compiler construction toolsCompiler construction tools
Compiler construction tools
 
Cd econtent link1
Cd econtent link1Cd econtent link1
Cd econtent link1
 
Algorithms and flow charts
Algorithms and flow chartsAlgorithms and flow charts
Algorithms and flow charts
 
Introduction to course
Introduction to courseIntroduction to course
Introduction to course
 
Programming Fundamentals and Programming Languages Concepts
Programming Fundamentals and Programming Languages ConceptsProgramming Fundamentals and Programming Languages Concepts
Programming Fundamentals and Programming Languages Concepts
 
Compiler type
Compiler typeCompiler type
Compiler type
 
What is Compiler?
What is Compiler?What is Compiler?
What is Compiler?
 
Converter - Computer Science & Engg. By Prof.(Dr.) Anand K. Tripathi
Converter - Computer Science & Engg. By Prof.(Dr.) Anand K. Tripathi  Converter - Computer Science & Engg. By Prof.(Dr.) Anand K. Tripathi
Converter - Computer Science & Engg. By Prof.(Dr.) Anand K. Tripathi
 

Similar to C program execution and algorithm

Programming languages,compiler,interpreter,softwares
Programming languages,compiler,interpreter,softwaresProgramming languages,compiler,interpreter,softwares
Programming languages,compiler,interpreter,softwaresNisarg Amin
 
PCSG_Computer_Science_Unit_1_Lecture_2.pptx
PCSG_Computer_Science_Unit_1_Lecture_2.pptxPCSG_Computer_Science_Unit_1_Lecture_2.pptx
PCSG_Computer_Science_Unit_1_Lecture_2.pptxAliyahAli19
 
System software module 1 presentation file
System software module 1 presentation fileSystem software module 1 presentation file
System software module 1 presentation filejithujithin657
 
Pros and cons of c as a compiler language
  Pros and cons of c as a compiler language  Pros and cons of c as a compiler language
Pros and cons of c as a compiler languageAshok Raj
 
The role of the cpu in the operation
The role of the cpu in the operationThe role of the cpu in the operation
The role of the cpu in the operationmary_ramsay
 
Introduction to computer programming
Introduction to computer programmingIntroduction to computer programming
Introduction to computer programmingSangheethaa Sukumaran
 
System Programing Unit 1
System Programing Unit 1System Programing Unit 1
System Programing Unit 1Manoj Patil
 
Embedded programming Embedded programming (1).pptx
Embedded programming Embedded programming (1).pptxEmbedded programming Embedded programming (1).pptx
Embedded programming Embedded programming (1).pptxlematadese670
 
Compiler Design Introduction
Compiler Design Introduction Compiler Design Introduction
Compiler Design Introduction Thapar Institute
 
Mba i-ifm-u-2-computer software
Mba i-ifm-u-2-computer softwareMba i-ifm-u-2-computer software
Mba i-ifm-u-2-computer softwareRai University
 
LESSON__1-15 C-PROGRAMMING.p algorithm df
LESSON__1-15 C-PROGRAMMING.p algorithm dfLESSON__1-15 C-PROGRAMMING.p algorithm df
LESSON__1-15 C-PROGRAMMING.p algorithm dfAparnaPriyadarsiniMe
 
Computer Programming By Prof.(Dr.) Anand K. Tripathi ,Mrs Monika Tripathi
Computer Programming By Prof.(Dr.) Anand K. Tripathi ,Mrs Monika TripathiComputer Programming By Prof.(Dr.) Anand K. Tripathi ,Mrs Monika Tripathi
Computer Programming By Prof.(Dr.) Anand K. Tripathi ,Mrs Monika TripathiProf. (Dr.) Anand K. Tripathi
 
Computer Programming In C.pptx
Computer Programming In C.pptxComputer Programming In C.pptx
Computer Programming In C.pptxchouguleamruta24
 
Compiler an overview
Compiler  an overviewCompiler  an overview
Compiler an overviewamudha arul
 
Mca i-fundamental of computer-u-2- application and system software
Mca  i-fundamental of  computer-u-2- application and system softwareMca  i-fundamental of  computer-u-2- application and system software
Mca i-fundamental of computer-u-2- application and system softwareRai University
 

Similar to C program execution and algorithm (20)

Programming languages,compiler,interpreter,softwares
Programming languages,compiler,interpreter,softwaresProgramming languages,compiler,interpreter,softwares
Programming languages,compiler,interpreter,softwares
 
PCSG_Computer_Science_Unit_1_Lecture_2.pptx
PCSG_Computer_Science_Unit_1_Lecture_2.pptxPCSG_Computer_Science_Unit_1_Lecture_2.pptx
PCSG_Computer_Science_Unit_1_Lecture_2.pptx
 
System software module 1 presentation file
System software module 1 presentation fileSystem software module 1 presentation file
System software module 1 presentation file
 
Chapter 1.pptx
Chapter 1.pptxChapter 1.pptx
Chapter 1.pptx
 
Pros and cons of c as a compiler language
  Pros and cons of c as a compiler language  Pros and cons of c as a compiler language
Pros and cons of c as a compiler language
 
The role of the cpu in the operation
The role of the cpu in the operationThe role of the cpu in the operation
The role of the cpu in the operation
 
Introduction to computer programming
Introduction to computer programmingIntroduction to computer programming
Introduction to computer programming
 
System Programing Unit 1
System Programing Unit 1System Programing Unit 1
System Programing Unit 1
 
Mcs lec2
Mcs lec2Mcs lec2
Mcs lec2
 
Embedded programming Embedded programming (1).pptx
Embedded programming Embedded programming (1).pptxEmbedded programming Embedded programming (1).pptx
Embedded programming Embedded programming (1).pptx
 
Compiler Design Introduction
Compiler Design Introduction Compiler Design Introduction
Compiler Design Introduction
 
Mba i-ifm-u-2-computer software
Mba i-ifm-u-2-computer softwareMba i-ifm-u-2-computer software
Mba i-ifm-u-2-computer software
 
01CHAP_1.PPT
01CHAP_1.PPT01CHAP_1.PPT
01CHAP_1.PPT
 
LESSON__1-15 C-PROGRAMMING.p algorithm df
LESSON__1-15 C-PROGRAMMING.p algorithm dfLESSON__1-15 C-PROGRAMMING.p algorithm df
LESSON__1-15 C-PROGRAMMING.p algorithm df
 
Computer Programming By Prof.(Dr.) Anand K. Tripathi ,Mrs Monika Tripathi
Computer Programming By Prof.(Dr.) Anand K. Tripathi ,Mrs Monika TripathiComputer Programming By Prof.(Dr.) Anand K. Tripathi ,Mrs Monika Tripathi
Computer Programming By Prof.(Dr.) Anand K. Tripathi ,Mrs Monika Tripathi
 
Chap01-Intro.ppt
Chap01-Intro.pptChap01-Intro.ppt
Chap01-Intro.ppt
 
Computer Programming In C.pptx
Computer Programming In C.pptxComputer Programming In C.pptx
Computer Programming In C.pptx
 
Ic lecture8
Ic lecture8 Ic lecture8
Ic lecture8
 
Compiler an overview
Compiler  an overviewCompiler  an overview
Compiler an overview
 
Mca i-fundamental of computer-u-2- application and system software
Mca  i-fundamental of  computer-u-2- application and system softwareMca  i-fundamental of  computer-u-2- application and system software
Mca i-fundamental of computer-u-2- application and system software
 

Recently uploaded

Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfkalichargn70th171
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendArshad QA
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
Active Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfActive Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfCionsystems
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 

Recently uploaded (20)

Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and Backend
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
Active Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfActive Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdf
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 

C program execution and algorithm

  • 1. ‘C’ LANGUAGE EXECUTION STEP’S & ALGORITHM PRESENTED BY- KUNAL K. PANDHRAM 1 ElectrohybridTech
  • 2. EXECUTION OF A PROGRAM electrohybridTech 2
  • 3. EXECUTION OF A PROGRAM (CONTD…) • Assembler 1. Self Assembler 2. Cross Assembler 1. One-Pass 2. Two-Pass • Compiler 1. Self Compiler 2. Cross Compiler • Linker • Interpreter • Loader electrohybridTech 3
  • 4. ASSEMBLER • Computer understand machine language. • Other language must be translated. • This translation is done with the help of software (Assembler). • Types : • Self ( Resident ) If an assembler which runs on a computer and produces the machine codes for the same computer then it is called self assembler or resident assembler. • Cross If an assembler that runs on a computer and produces the machine codes for other computer then it iselectrohybridTech 4
  • 5. • Types • One pass One pass assembler is the assembler which assigns the memory addresses to the variables and translates the source code into machine code in the first pass simultaneously. • Two pass -A Two Pass Assembler is the assembler which reads the source code twice. -In the first pass, it reads all the variables and assigns them memory addresses. -In the second pass, it reads the source code and translates the code into object code.electrohybridTech 5
  • 6. COMPILER • High level lang. to Machine level lang. • low speed (but faster than interpreter) and more memory • Types • Self ( Resident) • If a compiler runs on a computer and produces the machine codes for the same computer then it is known as a self compiler or resident compiler. • Cross • if a compiler runs on a computer and produces the machine codes for other computer then it is known as a cross compiler.electrohybridTech 6
  • 7. INTERPRETER • Translates statements of a program into machine code. • It translates only one statement of the program at a time. • A compiler is faster than an interpreter. • Small program as compared to compiler • Less memory electrohybridTech 7
  • 9. LINKER • Header files which contain functions to be executed. • These functions are linked to the libraries by a program called Linker. • If no linking, informs compiler and compiler generates error. • The compiler automatically invokes the linker as the last step in compiling a program. • If large prog., divides into subprog.(modules) and these modules are combined to execute. • The process of combining the modules is done by the linker.electrohybridTech 9
  • 10. LOADER • Loader is a program that loads machine codes of a program into the system memory. • It is one of the essential stages in the process of starting a program. • Loading a program involves reading the contents of executable file into memory. • Once loading is complete, the operating system starts the program by passing control to the loaded program code. electrohybridTech 10
  • 11. ALGORITHMS • A SEQUENTIAL SOLUTION OF ANY PROGRAM THAT WRITTEN IN HUMAN LANGUAGE, CALLED ALGORITHM. • ALGORITHM IS FIRST STEP OF THE SOLUTION PROCESS, AFTER THE ANALYSIS OF PROBLEM, PROGRAMMER WRITE THE ALGORITHM OF THAT PROBLEM. electrohybridTech 11
  • 12. PROPERTIES OF THE ALGORITHM 1) Finiteness: - an algorithm terminates after a finite numbers of steps. 2) Definiteness: - each step in algorithm is unambiguous. This means that the action specified by the step cannot be interpreted (explain the meaning of) in multiple ways & can be performed without any confusion. 3) Input:- an algorithm accepts zero or more inputs 4) Output:- it produces at least one output. 5) Effectiveness:- it consists of basic instructions that are realizable. This means that the instructions can be performed by using the given inputs in a finite amount of time.electrohybridTech 12
  • 13. FLOWCHART • Graphical representation of any program is called flowchart. • The flowchart is a means of visually presenting the flow of data, the operations performed and the sequence in which they are performed to solve a problem. • Flowcharts are generally drawn in the early stages of formulating computer solutions. These flowcharts play a vital role in the programming of a problem and are quite helpful in understanding the logic of complicated and lengthy problems. Once the flowchart is drawn, it becomes easy to write the program in any high level language. Flowcharts are helpful in explaining theelectrohybridTech 13
  • 14. FLOW CHART SYMBOLS Oval Terminal Parallegram Input/output Rectangle Process Document Hard copy Diamond Decision Circle Connector Double sided Rectangle Sub program Hexagon Iteration Trapezoid Manual Operation Cylinder Magnetic Disk Storage electrohybridTech 14
  • 15. ADVANTAGES OF USING FLOWCHART • Communication: Flowcharts are better way of communicating the logic of a system to all concerned. • Effective analysis: With the help of flowchart, problem can be analyzed in more effective way. • Proper documentation: Program flowcharts serve as a good program documentation, which is needed for various purposes. • Efficient Coding: The flowcharts act as a guide or blueprint during the systems analysis and program development phase. • Proper Debugging: The flowchart helps in debugging process. electrohybridTech 15
  • 16. LIMITATIONS OF USING FLOWCHARTS • Complex logic: Sometimes, the program logic is quite complicated. In that case, flowchart becomes complex and clumsy. • Alterations and Modifications: If alterations are required the flowchart may require re drawing completely. electrohybridTech 16
  • 17. PSEUDOCODE • Pseudocode is an informal high-level description of the operating principle of a computer program or other algorithm. • Pseudocode typically omits details that are not essential for human understanding of the algorithm. • The purpose of using pseudocode is that it is easier for people to understand than conventional programming language code. electrohybridTech 17
  • 18. Algorithm: Step by step procedure of solving a particular problem. Pseudo code: Artificial informal language used to develop algorithms. Flow chart: Graphical representation of an algorithm. Algorithm to find whether a number even or odd: Step1: Begin Step1: START Step2: Take a number Step2: Read num Step3: if the number is divisible by2 then Step3: if(num%2=0) then print that number is even print num is even otherwise print that number is odd otherwise print num is odd Step4: End Step4: STOP (Algorithm in natural language) (Algorithm by using pseudo code) #include<stdio.h> #include<conio.h> main() { int num; printf(“Enter any number”); scanf(“%d”,&num); if(num%2==0) printf(“%d is even”,num); else printf(%d is odd”,num); } (Program in C language) start read num print num is even stop If num%2 =0 print num is odd Flow chart: Yes No electrohybridTech 18
  • 19. electrohybridTech 19 Thank You ! For more details – Linkedin/kunalpandhram/sli deshare

Editor's Notes

  1. A computer will not understand any program written in a language, other than its machine language. The programs written in other languages must be translated into the machine language. Such translation is performed with the help of software. A program which translates an assembly language program into a machine language program is called an assembler. If an assembler which runs on a computer and produces the machine codes for the same computer then it is called self assembler or resident assembler. If an assembler that runs on a computer and produces the machine codes for other computer then it is called Cross Assembler.
  2. Compiler: It is a program which translates a high level language program into a machine language program. A compiler is more intelligent than an assembler. It checks all kinds of limits, ranges, errors etc. But its program run time is more and occupies a larger part of the memory. It has slow speed. Because a compiler goes through the entire program and then translates the entire program into machine codes. If a compiler runs on a computer and produces the machine codes for the same computer then it is known as a self compiler or resident compiler. On the other hand, if a compiler runs on a computer and produces the machine codes for other computer then it is known as a cross compiler.
  3. Linker: In high level languages, some built in header files or libraries are stored. These libraries are predefined and these contain basic functions which are essential for executing the program. These functions are linked to the libraries by a program called Linker. If linker does not find a library of a function then it informs to compiler and then compiler generates an error. The compiler automatically invokes the linker as the last step in compiling a program. Not built in libraries, it also links the user defined functions to the user defined libraries. Usually a longer program is divided into smaller subprograms called modules. And these modules must be combined to execute the program. The process of combining the modules is done by the linker.
  4. Loader: Loader is a program that loads machine codes of a program into the system memory. In Computing, a loader is the part of an Operating System that is responsible for loading programs. It is one of the essential stages in the process of starting a program. Because it places programs into memory and prepares them for execution. Loading a program involves reading the contents of executable file into memory. Once loading is complete, the operating system starts the program by passing control to the loaded program code. All operating systems that support program loading have loaders. In many operating systems the loader is permanently resident in memory
  5. It is a sequence of instructions to be carried out in order to solve a specific problem. In designing a solution, we write step by step procedures for solving the problem. Such process is called algorithm. Algorithm can be written in any language according to the convenience of the program developer.
  6. The flowchart is a means of visually presenting the flow of data, the operations performed and the sequence in which they are performed to solve a problem.  A flowchart is a diagrammatic representation that represents the sequence of operations to be performed to get the solution of a problem. Flowcharts are generally drawn in the early stages of formulating computer solutions. These flowcharts play a vital role in the programming of a problem and are quite helpful in understanding the logic of complicated and lengthy problems. Once the flowchart is drawn, it becomes easy to write the program in any high level language. flowcharts are helpful in explaining the program to others.