SlideShare a Scribd company logo
Unit 1
 Flowchart: Elements, Identifying and understanding
input/ output, Branching and iteration in flowchart
 Algorithm design: Problem solving approach(top
down/bottom up approach)
 Pseudo Code : Representation of different construct,
writing pseudo-code from algorithm and flowchart
Programming:
A typical programming task can be divided into two phases:
a) Problem solving phase: produce an ordered sequence of steps that
describe solution of problem. This sequence of steps is called an algorithm.
b) Implementation phase: Implement the program in some programming
language.
• A computer performs many tasks exactly in the same manner as it is told to do.
• This places responsibility on the user to instruct the computer in a correct and precise
manner, so that the machine is able to perform the required job in a proper way.
• A wrong or ambiguous instruction may sometimes prove disastrous. In order to instruct a
computer correctly, the user must have clear understanding of the problem to be solved.
• A part from this he should be able to develop a method, in the form of series of
sequential steps, to solve it.
• Once the problem is well-defined and a method of solving it is developed, then
instructing he computer to solve the problem becomes relatively easier task.
Problem Solving
• A computer cannot solve a problem on its own. One has to provide step by step solutions of the
problem to the computer. In fact, the task of problem solving is not that of the computer.
• It is the programmer who has to write down the solution to the problem in terms of simple
operations which the computer can understand and execute.
• In order to solve a problem by the computer, one has to pass though certain stages or steps.
They are :
1. Understanding the problem
2. Analyzing the problem
3. Outline problem requirements
4. Developing the solution/algorithm
5. Coding and implementation
1. Understanding the problem: Here we try to understand the problem to be solved in totally. Before
with the next stage or step, we should be absolutely sure about the objectives of the given problem.
2. Analyzing the problem: After understanding thoroughly the problem to be solved, we look different
ways of solving the problem and evaluate each of these methods. The idea here is to search an
appropriate solution to the problem under consideration. The end result of this stage is a broad
overview of the sequence of operations that are to be carries out to solve the given problem.
3. Outline problem requirements: identify requirements of the problem in terms of number of
variables required, formula etc
4. Developing the solution/algorithm: Here the overview of the sequence of operations that was the
result of analysis stage is expanded to form a detailed step by step solution to the problem under
consideration.
5. Coding and implementation: The last stage of the problem solving is the conversion of the detailed
sequence of operations in to a language that the computer can understand. Here each step is
converted to its equivalent instruction or instructions in the computer language that has been chosen
for the implantation.
Analyze the problem
1) Thoroughly understand the problem
2) Understand problem requirements
 does the program require interaction?
 does program manipulate data?
what will be the output?
3) If the problem is complex, divide it into subproblems
analyse each sub problem as above
Algorithm
Definition: A set of sequential steps that define how a task is to be performed.
• Solves a well specified problem in a general way.
• Algorithm remains the same independent of:
Which kind of hardware it is running on
Which programming language it is written in
• It may be possible to solve to problem in more than one ways, resulting in more than one
algorithm.
• The choice of various algorithms depends on the factors like reliability, accuracy and easy to modify.
• The most important factor in the choice of algorithm is the time requirement to execute it, after
writing code in High-level language with the help of a computer.
• The algorithm which will need the least time when executed is considered the best.
Algorithm Properties/characteristics
1. Input/output: Each algorithm must take zero, one or more quantities as input data
produce one or more output values.
2. Finiteness: An algorithm must terminate in a finite number of steps
3. Definiteness: Each step of the algorithm must be precisely and unambiguously stated
4. Effectiveness: Each step must be effective, in the sense that it should be primitive easily
(convert able into program statement) can be performed exactly in a finite amount of time.
5. Generality: The algorithm must be complete in itself so that it can be used to solve
problems of a specific type for any input data.
An algorithm can be written in English like sentences or in any standard representation
sometimes, algorithm written in English like languages are called Pseudo Code
Steps involved in algorithm development
• An algorithm can be defined as “a complete, unambiguous, finite number of logical
steps for solving a specific problem “
• Step1. Identify input: For an algorithm, there are quantities to be supplied called
input and these are fed externally. The input is to be identified first for any specified
problem.
• Step2: Identify output: From an algorithm, at least one quantity is produced, called
for any specified problem.
• Step3 : Identify processing operations : All the calculations to be performed in order
to lead to output from the input are to be identified in an orderly manner.
• Step4: Processing Finiteness : If we go through the algorithm, then for all cases, the
algorithm should terminate after a finite number of steps.
Algorithm constructs
1) Sequence
a number of instructions are processed one after another.
statement 1;
statement 1;
statement 1;
2) Decision /selection
The next instruction to be executed depends on a 'condition’ :
if (condition is true) then
statement 1;
else
statement 2;
else
statement 3;
end if
3) Iteration
if want to perform a number of steps again and again
a) …. A fixed number of times
for 20 times do
statement 1;
statement 2;
……………
end do
b) ….. Until a condition is met
Example 1 : write algorithm to find the average of three numbers
• Step 1 start
• Step 2 Read the numbers a, b, c
• Step 3 Compute the sum of a, b and c
• Step 4 Divide the sum by 3
• Step 5 Store the result in variable d
• Step 6 Print the value of d
• Step 7 End
Example 2 : Write an algorithm to calculate the simple interest using the formula.
Simple interest = P*N* R/100.
Where P is principle Amount, N is the number of years and R is the rate of interest.
Step 1: start
Step 2 : Read the three input quantities’ P, N and R.
Step 3 : Calculate simple interest as Simple interest = P* N* R/100
Step 4: Print simple interest.
Step 5: Stop.
Example: Write an algorithm to calculate the perimeter and area of
rectangle. Given its length and width.
Step 1: start
Step 2: Read length of the rectangle.
Step 3: Read width of the rectangle.
Step 4: Calculate perimeter of the rectangle using the formula
perimeter = 2* (length + width)
Step 5: Calculate area of the rectangle using the formula
area = length *width.
Step 6: Print perimeter.
Step 7: Print area.
Step 8: Stop.
Questions : write algorithm and program
1) The distance between two cities(in km) is input through the keyboard. Write an algorithm and
program to convert and print this distance in meters, feet, inches and centimeters
2) Two numbers are input through the keyboard into locations C and D. write an algorithm and
program to interchange the contents of C and D
3) Write an algorithm to find whether the number is even or odd.
4) Write an algorithm to print whether the
5) Write an algorithm to print sum, mult, sub, div of two numbers
6) Write an algorithm to calculate simple interest.
7) Write an algorithm to read 3 numbers from the user. Print their sum and average.
8) Write an algorithm to read basic salary from the user and compute HRA – 12% of basic, DA- 64%
of basic, allowance -15% of basic. Also display total salary.
9) Write an algorithm to find area and perimeter of square
10) Write an algorithm to find area and perimeter of circle
11) Write an algorithm to find area of triangle using hero’s formula
Algorithm design:
Problem solving approach
(top down/bottom up approach)
• A programming approach is nothing but way of solving the computational
problem.
• Two approaches:
a) Top down
b) Bottom up
Top down approach
• “top down” approach is nothing but resolving the problem from high level to low level.
Basically you start from the whole problem.
• Top down :
1) Take the whole problem and split it into two or more parts.
2) Find solution to these parts.
3) If these parts turn out to be too big to be solved as a whole, split them further and find
find solutions to those sub-parts.
4) Merge solutions according to the sub-problem hierarchy thus created after all parts have
been successfully solved.
Bottom up approach
• In "bottom up" approach, you identify lower-level tools that you can compose to become a
bigger program. Basically you focus on parts of the problem to solve it.
• Bottom up :
1) Breaking the problem into smallest possible(and practical) parts.
2) Finding solutions to these small sub-problems.
3) Merging the solutions you get iteratively(again and again) till you have merged all of them
to get the final solution to the "big"
problem.
The main difference in approach is splitting versus merging. You either start big and split
"down" as required or start with the smallest and merge your way "up" to the final solution.
Program structure in top down Vs bottom up approach
C LANGUAGE-FLOWCHARTS,PSEUDOCODE,ALGORITHMS APPROCHES
Role of sub algorithm
• Algorithms are often broken down into smaller chunks, called Subalgorithm. This is both so that they are easier to
read, and also because then parts of the algorithm can be reused.
• A sub-algorithm is an algorithmic module which is complete in itself and has independent existence.
• It can be used or called by some main algorithm or by some other sub-algorithm.
• It may or may not receive values from a calling algorithm. These values are called arguments or
parameters.
• The sub-algorithm performs its task and then sends back the result to the calling algorithm. It can be
called by many different algorithms or called at different places in the same algorithm.
• The relationship between an algorithm and a sub-algorithm is similar to the relationship between a
main program (function) and a sub-program (sub-function) in a programming language.
Usefulness
• When the problem is very complex, it is divided into several independent
sub-problems. Each sub-problem is called sub-algorithm and can be
developed independently. These sub-problems can be combined together to
form the solution for the entire problem. Thus by using sub-algorithms the
complex problems can be solved easily.
Questions
1) C follows top down or bottom up approach? Why?
2) Give names of programming language which follows top down and
bottom up approach.
3) What is the role of subalgorithm? What is relationship between main
algorithm and sub algorithm?
Assignment: write algorithm
1) The current year and the year in which the employee joined the organization are entered through the keyboard.
If the number of years for which the employee has served the organization is greater than 3 then a bonus of
Rs. 2500/- is given to the employee. If the years of service are not greater than 3, then the program should do
nothing.
2) In a company an employee is paid as under:
If his basic salary is less than Rs. 1500, then HRA = 10% of basic salary and DA = 90% of basic salary. If his
salary is either equal to or above Rs. 1500, then HRA = Rs. 500 and DA = 98% of basic salary. If the employee's
salary is input through the keyboard write a program to find his gross salary.
3) The marks obtained by a student in 5 different subjects are input through the keyboard. The student gets a
division as per the following rules:
Percentage above or equal to 60 - First division
Percentage between 50 and 59 - Second division
Percentage between 40 and 49 - Third division Percentage less than 40 - Fail
calculate the division obtained by the student.
4) Calculate salary
5) If the ages of Ram, Shyam and Ajay are input through the keyboard. determine the youngest of the three.
6) Two numbers are input through the keyboard into locations C and D. write an algorithm and program to interchange the
contents of C and D
7)Write an algorithm to find whether the number is even or odd.
8) Write algorithm to check whether a triangle is valid or not, when the three angles of the triangle are entered through
the keyboard. A triangle is valid if the sum of all the three angles is equal to 180 degrees.
7) A company insures its drivers in the following cases: −
- If the driver is married.
- If the driver is unmarried, male & above 30 years of age.
- If the driver is unmarried, female & above 25 years of age.
8) Any integer is input through the keyboard. find out whether it is an odd
number or even number.
9) Any year is input through the keyboard. Determine whether the year is a
leap year or not. (Hint: Use the % (modulus) operator)
Unit 1
 Flowchart: Elements, Identifying and understanding
input/ output, Branching and iteration in flowchart
 Algorithm design: Problem solving approach(top
down/bottom up approach)
 Pseudo Code : Representation of different construct,
writing pseudo-code from algorithm and flowchart
C LANGUAGE-FLOWCHARTS,PSEUDOCODE,ALGORITHMS APPROCHES
C LANGUAGE-FLOWCHARTS,PSEUDOCODE,ALGORITHMS APPROCHES
C LANGUAGE-FLOWCHARTS,PSEUDOCODE,ALGORITHMS APPROCHES
C LANGUAGE-FLOWCHARTS,PSEUDOCODE,ALGORITHMS APPROCHES
C LANGUAGE-FLOWCHARTS,PSEUDOCODE,ALGORITHMS APPROCHES
C LANGUAGE-FLOWCHARTS,PSEUDOCODE,ALGORITHMS APPROCHES
C LANGUAGE-FLOWCHARTS,PSEUDOCODE,ALGORITHMS APPROCHES
C LANGUAGE-FLOWCHARTS,PSEUDOCODE,ALGORITHMS APPROCHES
C LANGUAGE-FLOWCHARTS,PSEUDOCODE,ALGORITHMS APPROCHES
C LANGUAGE-FLOWCHARTS,PSEUDOCODE,ALGORITHMS APPROCHES
C LANGUAGE-FLOWCHARTS,PSEUDOCODE,ALGORITHMS APPROCHES
C LANGUAGE-FLOWCHARTS,PSEUDOCODE,ALGORITHMS APPROCHES
C LANGUAGE-FLOWCHARTS,PSEUDOCODE,ALGORITHMS APPROCHES
C LANGUAGE-FLOWCHARTS,PSEUDOCODE,ALGORITHMS APPROCHES
C LANGUAGE-FLOWCHARTS,PSEUDOCODE,ALGORITHMS APPROCHES
C LANGUAGE-FLOWCHARTS,PSEUDOCODE,ALGORITHMS APPROCHES
C LANGUAGE-FLOWCHARTS,PSEUDOCODE,ALGORITHMS APPROCHES
C LANGUAGE-FLOWCHARTS,PSEUDOCODE,ALGORITHMS APPROCHES
C LANGUAGE-FLOWCHARTS,PSEUDOCODE,ALGORITHMS APPROCHES
C LANGUAGE-FLOWCHARTS,PSEUDOCODE,ALGORITHMS APPROCHES
Unit 1
 Flowchart: Elements, Identifying and understanding
input/ output, Branching and iteration in flowchart
 Algorithm design: Problem solving approach(top
down/bottom up approach)
 Pseudo Code : Representation of different
construct, writing pseudo-code from algorithm and
flowchart
C LANGUAGE-FLOWCHARTS,PSEUDOCODE,ALGORITHMS APPROCHES
C LANGUAGE-FLOWCHARTS,PSEUDOCODE,ALGORITHMS APPROCHES
Like flowcharting, there are many elements to pseudocode design, only the
most
rudimentary are described here.
Get used to get information from the user
Display used to display information for the user
Compute perform an arithmetic operation
+
-
* Standard arithmetic operators
/
=
( )
Store Store a piece of information for later use
C LANGUAGE-FLOWCHARTS,PSEUDOCODE,ALGORITHMS APPROCHES
C LANGUAGE-FLOWCHARTS,PSEUDOCODE,ALGORITHMS APPROCHES
C LANGUAGE-FLOWCHARTS,PSEUDOCODE,ALGORITHMS APPROCHES
C LANGUAGE-FLOWCHARTS,PSEUDOCODE,ALGORITHMS APPROCHES
C LANGUAGE-FLOWCHARTS,PSEUDOCODE,ALGORITHMS APPROCHES
C LANGUAGE-FLOWCHARTS,PSEUDOCODE,ALGORITHMS APPROCHES
C LANGUAGE-FLOWCHARTS,PSEUDOCODE,ALGORITHMS APPROCHES
C LANGUAGE-FLOWCHARTS,PSEUDOCODE,ALGORITHMS APPROCHES
C LANGUAGE-FLOWCHARTS,PSEUDOCODE,ALGORITHMS APPROCHES
C LANGUAGE-FLOWCHARTS,PSEUDOCODE,ALGORITHMS APPROCHES
Ad

Recommended

DFS and BFS
DFS and BFS
satya parsana
 
SOFTWARE RELIABILITY AND QUALITY ASSURANCE
SOFTWARE RELIABILITY AND QUALITY ASSURANCE
Amity University | FMS - DU | IMT | Stratford University | KKMI International Institute | AIMA | DTU
 
NFA Non Deterministic Finite Automata by Mudasir khushik
NFA Non Deterministic Finite Automata by Mudasir khushik
MudsaraliKhushik
 
Compiler Design- Machine Independent Optimizations
Compiler Design- Machine Independent Optimizations
Jyothishmathi Institute of Technology and Science Karimnagar
 
Algorithms, flow charts and pseudocodes
Algorithms, flow charts and pseudocodes
Satveer Mann
 
LL(1) parsing
LL(1) parsing
KHYATI PATEL
 
Regular Expression
Regular Expression
valuebound
 
Regular Expression Examples.pptx
Regular Expression Examples.pptx
GhulamRabani9
 
10.m way search tree
10.m way search tree
Chandan Singh
 
Flowchart and algorithm
Flowchart and algorithm
DHANIK VIKRANT
 
Highway Geometric Design.pptx
Highway Geometric Design.pptx
Priya Sarita Mane
 
Algorithm Introduction
Algorithm Introduction
Ashim Lamichhane
 
Daa unit 1
Daa unit 1
jinalgoti
 
Finite state Transducers and mealy Machine
Finite state Transducers and mealy Machine
Nadeem Qasmi
 
Parallel sorting algorithm
Parallel sorting algorithm
Richa Kumari
 
Historia de la criptografia 1
Historia de la criptografia 1
Juan Carlos Broncanotorres
 
Roadway condition survey & Traffic Volume Study
Roadway condition survey & Traffic Volume Study
Stone Rayhan
 
Flow Network Talk
Flow Network Talk
Imane Haf
 
TOC 7 | CFG in Chomsky Normal Form
TOC 7 | CFG in Chomsky Normal Form
Mohammad Imam Hossain
 
Logic Development and Algorithm.
Logic Development and Algorithm.
NandiniSidana
 
Algorithm for computational problematic sit
Algorithm for computational problematic sit
Saurabh846965
 
PROGRAMMING IN C UNIT I.pdffffffffffffffffffffffffd
PROGRAMMING IN C UNIT I.pdffffffffffffffffffffffffd
dinesh620610
 
Algorithm types performance steps working
Algorithm types performance steps working
Saurabh846965
 
Algorithm.pdf
Algorithm.pdf
MIT,Imphal
 
UNIT-1.pptx python for engineering first year students
UNIT-1.pptx python for engineering first year students
SabarigiriVason
 
Algorithms and how to write an algorithms
Algorithms and how to write an algorithms
Ahmed Nobi
 
Program concep sequential statements
Program concep sequential statements
ankurkhanna
 
Problem solving methodology
Problem solving methodology
Prof. Dr. K. Adisesha
 
AOA Week 01.ppt
AOA Week 01.ppt
INAM352782
 
Lecture 2 role of algorithms in computing
Lecture 2 role of algorithms in computing
jayavignesh86
 

More Related Content

What's hot (11)

10.m way search tree
10.m way search tree
Chandan Singh
 
Flowchart and algorithm
Flowchart and algorithm
DHANIK VIKRANT
 
Highway Geometric Design.pptx
Highway Geometric Design.pptx
Priya Sarita Mane
 
Algorithm Introduction
Algorithm Introduction
Ashim Lamichhane
 
Daa unit 1
Daa unit 1
jinalgoti
 
Finite state Transducers and mealy Machine
Finite state Transducers and mealy Machine
Nadeem Qasmi
 
Parallel sorting algorithm
Parallel sorting algorithm
Richa Kumari
 
Historia de la criptografia 1
Historia de la criptografia 1
Juan Carlos Broncanotorres
 
Roadway condition survey & Traffic Volume Study
Roadway condition survey & Traffic Volume Study
Stone Rayhan
 
Flow Network Talk
Flow Network Talk
Imane Haf
 
TOC 7 | CFG in Chomsky Normal Form
TOC 7 | CFG in Chomsky Normal Form
Mohammad Imam Hossain
 
10.m way search tree
10.m way search tree
Chandan Singh
 
Flowchart and algorithm
Flowchart and algorithm
DHANIK VIKRANT
 
Highway Geometric Design.pptx
Highway Geometric Design.pptx
Priya Sarita Mane
 
Finite state Transducers and mealy Machine
Finite state Transducers and mealy Machine
Nadeem Qasmi
 
Parallel sorting algorithm
Parallel sorting algorithm
Richa Kumari
 
Roadway condition survey & Traffic Volume Study
Roadway condition survey & Traffic Volume Study
Stone Rayhan
 
Flow Network Talk
Flow Network Talk
Imane Haf
 

Similar to C LANGUAGE-FLOWCHARTS,PSEUDOCODE,ALGORITHMS APPROCHES (20)

Logic Development and Algorithm.
Logic Development and Algorithm.
NandiniSidana
 
Algorithm for computational problematic sit
Algorithm for computational problematic sit
Saurabh846965
 
PROGRAMMING IN C UNIT I.pdffffffffffffffffffffffffd
PROGRAMMING IN C UNIT I.pdffffffffffffffffffffffffd
dinesh620610
 
Algorithm types performance steps working
Algorithm types performance steps working
Saurabh846965
 
Algorithm.pdf
Algorithm.pdf
MIT,Imphal
 
UNIT-1.pptx python for engineering first year students
UNIT-1.pptx python for engineering first year students
SabarigiriVason
 
Algorithms and how to write an algorithms
Algorithms and how to write an algorithms
Ahmed Nobi
 
Program concep sequential statements
Program concep sequential statements
ankurkhanna
 
Problem solving methodology
Problem solving methodology
Prof. Dr. K. Adisesha
 
AOA Week 01.ppt
AOA Week 01.ppt
INAM352782
 
Lecture 2 role of algorithms in computing
Lecture 2 role of algorithms in computing
jayavignesh86
 
Data Structures_Introduction to algorithms.pptx
Data Structures_Introduction to algorithms.pptx
RushaliDeshmukh2
 
Algorithm and flowchart with pseudo code
Algorithm and flowchart with pseudo code
hamza javed
 
CC-112-Lec.1.ppsx
CC-112-Lec.1.ppsx
Aamir Shahzad
 
Introduction to Problem Solving Techniques
Introduction to Problem Solving Techniques
Sitamarhi Institute of Technology
 
Problem solving techniques in c language
Problem solving techniques in c language
John Bruslin
 
ANALYSIS AND DESIGN OF ALGORITHMS -M1-PPT
ANALYSIS AND DESIGN OF ALGORITHMS -M1-PPT
AIET
 
Programming C ppt for learning foundations
Programming C ppt for learning foundations
ssuser65733f
 
Lec-ProblemSolving.pptx
Lec-ProblemSolving.pptx
miansaad18
 
Module 1 python.pptx
Module 1 python.pptx
AnuragJoshi813963
 
Logic Development and Algorithm.
Logic Development and Algorithm.
NandiniSidana
 
Algorithm for computational problematic sit
Algorithm for computational problematic sit
Saurabh846965
 
PROGRAMMING IN C UNIT I.pdffffffffffffffffffffffffd
PROGRAMMING IN C UNIT I.pdffffffffffffffffffffffffd
dinesh620610
 
Algorithm types performance steps working
Algorithm types performance steps working
Saurabh846965
 
UNIT-1.pptx python for engineering first year students
UNIT-1.pptx python for engineering first year students
SabarigiriVason
 
Algorithms and how to write an algorithms
Algorithms and how to write an algorithms
Ahmed Nobi
 
Program concep sequential statements
Program concep sequential statements
ankurkhanna
 
AOA Week 01.ppt
AOA Week 01.ppt
INAM352782
 
Lecture 2 role of algorithms in computing
Lecture 2 role of algorithms in computing
jayavignesh86
 
Data Structures_Introduction to algorithms.pptx
Data Structures_Introduction to algorithms.pptx
RushaliDeshmukh2
 
Algorithm and flowchart with pseudo code
Algorithm and flowchart with pseudo code
hamza javed
 
Problem solving techniques in c language
Problem solving techniques in c language
John Bruslin
 
ANALYSIS AND DESIGN OF ALGORITHMS -M1-PPT
ANALYSIS AND DESIGN OF ALGORITHMS -M1-PPT
AIET
 
Programming C ppt for learning foundations
Programming C ppt for learning foundations
ssuser65733f
 
Lec-ProblemSolving.pptx
Lec-ProblemSolving.pptx
miansaad18
 
Ad

Recently uploaded (20)

Introduction to Agile Frameworks for Product Managers.pdf
Introduction to Agile Frameworks for Product Managers.pdf
Ali Vahed
 
Reimagining Software Development and DevOps with Agentic AI
Reimagining Software Development and DevOps with Agentic AI
Maxim Salnikov
 
Emvigo Capability Deck 2025: Accelerating Innovation Through Intelligent Soft...
Emvigo Capability Deck 2025: Accelerating Innovation Through Intelligent Soft...
Emvigo Technologies
 
Who will create the languages of the future?
Who will create the languages of the future?
Jordi Cabot
 
OpenChain Webinar - AboutCode - Practical Compliance in One Stack – Licensing...
OpenChain Webinar - AboutCode - Practical Compliance in One Stack – Licensing...
Shane Coughlan
 
Automated Migration of ESRI Geodatabases Using XML Control Files and FME
Automated Migration of ESRI Geodatabases Using XML Control Files and FME
Safe Software
 
Making significant Software Architecture decisions
Making significant Software Architecture decisions
Bert Jan Schrijver
 
Test Case Design Techniques – Practical Examples & Best Practices in Software...
Test Case Design Techniques – Practical Examples & Best Practices in Software...
Muhammad Fahad Bashir
 
openSAP_s4h27_Week_1_2025_All_Slides.pdf
openSAP_s4h27_Week_1_2025_All_Slides.pdf
Thomas Qiao
 
IDM Crack with Internet Download Manager 6.42 Build 41 [Latest 2025]
IDM Crack with Internet Download Manager 6.42 Build 41 [Latest 2025]
pcprocore
 
On-Device AI: Is It Time to Go All-In, or Do We Still Need the Cloud?
On-Device AI: Is It Time to Go All-In, or Do We Still Need the Cloud?
Hassan Abid
 
Application Modernization with Choreo - The AI-Native Internal Developer Plat...
Application Modernization with Choreo - The AI-Native Internal Developer Plat...
WSO2
 
Foundations of Marketo Engage - Programs, Campaigns & Beyond - June 2025
Foundations of Marketo Engage - Programs, Campaigns & Beyond - June 2025
BradBedford3
 
Y - Recursion The Hard Way GopherCon EU 2025
Y - Recursion The Hard Way GopherCon EU 2025
Eleanor McHugh
 
Download Adobe Illustrator Crack free for Windows 2025?
Download Adobe Illustrator Crack free for Windows 2025?
grete1122g
 
A Guide to Telemedicine Software Development.pdf
A Guide to Telemedicine Software Development.pdf
Olivero Bozzelli
 
IObit Driver Booster Pro 12 Crack Latest Version Download
IObit Driver Booster Pro 12 Crack Latest Version Download
pcprocore
 
Azure AI Foundry: The AI app and agent factory
Azure AI Foundry: The AI app and agent factory
Maxim Salnikov
 
arctitecture application system design os dsa
arctitecture application system design os dsa
za241967
 
Microsoft Business-230T01A-ENU-PowerPoint_01.pptx
Microsoft Business-230T01A-ENU-PowerPoint_01.pptx
soulamaabdoulaye128
 
Introduction to Agile Frameworks for Product Managers.pdf
Introduction to Agile Frameworks for Product Managers.pdf
Ali Vahed
 
Reimagining Software Development and DevOps with Agentic AI
Reimagining Software Development and DevOps with Agentic AI
Maxim Salnikov
 
Emvigo Capability Deck 2025: Accelerating Innovation Through Intelligent Soft...
Emvigo Capability Deck 2025: Accelerating Innovation Through Intelligent Soft...
Emvigo Technologies
 
Who will create the languages of the future?
Who will create the languages of the future?
Jordi Cabot
 
OpenChain Webinar - AboutCode - Practical Compliance in One Stack – Licensing...
OpenChain Webinar - AboutCode - Practical Compliance in One Stack – Licensing...
Shane Coughlan
 
Automated Migration of ESRI Geodatabases Using XML Control Files and FME
Automated Migration of ESRI Geodatabases Using XML Control Files and FME
Safe Software
 
Making significant Software Architecture decisions
Making significant Software Architecture decisions
Bert Jan Schrijver
 
Test Case Design Techniques – Practical Examples & Best Practices in Software...
Test Case Design Techniques – Practical Examples & Best Practices in Software...
Muhammad Fahad Bashir
 
openSAP_s4h27_Week_1_2025_All_Slides.pdf
openSAP_s4h27_Week_1_2025_All_Slides.pdf
Thomas Qiao
 
IDM Crack with Internet Download Manager 6.42 Build 41 [Latest 2025]
IDM Crack with Internet Download Manager 6.42 Build 41 [Latest 2025]
pcprocore
 
On-Device AI: Is It Time to Go All-In, or Do We Still Need the Cloud?
On-Device AI: Is It Time to Go All-In, or Do We Still Need the Cloud?
Hassan Abid
 
Application Modernization with Choreo - The AI-Native Internal Developer Plat...
Application Modernization with Choreo - The AI-Native Internal Developer Plat...
WSO2
 
Foundations of Marketo Engage - Programs, Campaigns & Beyond - June 2025
Foundations of Marketo Engage - Programs, Campaigns & Beyond - June 2025
BradBedford3
 
Y - Recursion The Hard Way GopherCon EU 2025
Y - Recursion The Hard Way GopherCon EU 2025
Eleanor McHugh
 
Download Adobe Illustrator Crack free for Windows 2025?
Download Adobe Illustrator Crack free for Windows 2025?
grete1122g
 
A Guide to Telemedicine Software Development.pdf
A Guide to Telemedicine Software Development.pdf
Olivero Bozzelli
 
IObit Driver Booster Pro 12 Crack Latest Version Download
IObit Driver Booster Pro 12 Crack Latest Version Download
pcprocore
 
Azure AI Foundry: The AI app and agent factory
Azure AI Foundry: The AI app and agent factory
Maxim Salnikov
 
arctitecture application system design os dsa
arctitecture application system design os dsa
za241967
 
Microsoft Business-230T01A-ENU-PowerPoint_01.pptx
Microsoft Business-230T01A-ENU-PowerPoint_01.pptx
soulamaabdoulaye128
 
Ad

C LANGUAGE-FLOWCHARTS,PSEUDOCODE,ALGORITHMS APPROCHES

  • 1. Unit 1  Flowchart: Elements, Identifying and understanding input/ output, Branching and iteration in flowchart  Algorithm design: Problem solving approach(top down/bottom up approach)  Pseudo Code : Representation of different construct, writing pseudo-code from algorithm and flowchart
  • 2. Programming: A typical programming task can be divided into two phases: a) Problem solving phase: produce an ordered sequence of steps that describe solution of problem. This sequence of steps is called an algorithm. b) Implementation phase: Implement the program in some programming language.
  • 3. • A computer performs many tasks exactly in the same manner as it is told to do. • This places responsibility on the user to instruct the computer in a correct and precise manner, so that the machine is able to perform the required job in a proper way. • A wrong or ambiguous instruction may sometimes prove disastrous. In order to instruct a computer correctly, the user must have clear understanding of the problem to be solved. • A part from this he should be able to develop a method, in the form of series of sequential steps, to solve it. • Once the problem is well-defined and a method of solving it is developed, then instructing he computer to solve the problem becomes relatively easier task.
  • 4. Problem Solving • A computer cannot solve a problem on its own. One has to provide step by step solutions of the problem to the computer. In fact, the task of problem solving is not that of the computer. • It is the programmer who has to write down the solution to the problem in terms of simple operations which the computer can understand and execute. • In order to solve a problem by the computer, one has to pass though certain stages or steps. They are : 1. Understanding the problem 2. Analyzing the problem 3. Outline problem requirements 4. Developing the solution/algorithm 5. Coding and implementation
  • 5. 1. Understanding the problem: Here we try to understand the problem to be solved in totally. Before with the next stage or step, we should be absolutely sure about the objectives of the given problem. 2. Analyzing the problem: After understanding thoroughly the problem to be solved, we look different ways of solving the problem and evaluate each of these methods. The idea here is to search an appropriate solution to the problem under consideration. The end result of this stage is a broad overview of the sequence of operations that are to be carries out to solve the given problem. 3. Outline problem requirements: identify requirements of the problem in terms of number of variables required, formula etc 4. Developing the solution/algorithm: Here the overview of the sequence of operations that was the result of analysis stage is expanded to form a detailed step by step solution to the problem under consideration. 5. Coding and implementation: The last stage of the problem solving is the conversion of the detailed sequence of operations in to a language that the computer can understand. Here each step is converted to its equivalent instruction or instructions in the computer language that has been chosen for the implantation.
  • 6. Analyze the problem 1) Thoroughly understand the problem 2) Understand problem requirements  does the program require interaction?  does program manipulate data? what will be the output? 3) If the problem is complex, divide it into subproblems analyse each sub problem as above
  • 7. Algorithm Definition: A set of sequential steps that define how a task is to be performed. • Solves a well specified problem in a general way. • Algorithm remains the same independent of: Which kind of hardware it is running on Which programming language it is written in • It may be possible to solve to problem in more than one ways, resulting in more than one algorithm. • The choice of various algorithms depends on the factors like reliability, accuracy and easy to modify. • The most important factor in the choice of algorithm is the time requirement to execute it, after writing code in High-level language with the help of a computer. • The algorithm which will need the least time when executed is considered the best.
  • 8. Algorithm Properties/characteristics 1. Input/output: Each algorithm must take zero, one or more quantities as input data produce one or more output values. 2. Finiteness: An algorithm must terminate in a finite number of steps 3. Definiteness: Each step of the algorithm must be precisely and unambiguously stated 4. Effectiveness: Each step must be effective, in the sense that it should be primitive easily (convert able into program statement) can be performed exactly in a finite amount of time. 5. Generality: The algorithm must be complete in itself so that it can be used to solve problems of a specific type for any input data. An algorithm can be written in English like sentences or in any standard representation sometimes, algorithm written in English like languages are called Pseudo Code
  • 9. Steps involved in algorithm development • An algorithm can be defined as “a complete, unambiguous, finite number of logical steps for solving a specific problem “ • Step1. Identify input: For an algorithm, there are quantities to be supplied called input and these are fed externally. The input is to be identified first for any specified problem. • Step2: Identify output: From an algorithm, at least one quantity is produced, called for any specified problem. • Step3 : Identify processing operations : All the calculations to be performed in order to lead to output from the input are to be identified in an orderly manner. • Step4: Processing Finiteness : If we go through the algorithm, then for all cases, the algorithm should terminate after a finite number of steps.
  • 10. Algorithm constructs 1) Sequence a number of instructions are processed one after another. statement 1; statement 1; statement 1; 2) Decision /selection The next instruction to be executed depends on a 'condition’ : if (condition is true) then statement 1; else statement 2; else statement 3; end if
  • 11. 3) Iteration if want to perform a number of steps again and again a) …. A fixed number of times for 20 times do statement 1; statement 2; …………… end do b) ….. Until a condition is met
  • 12. Example 1 : write algorithm to find the average of three numbers • Step 1 start • Step 2 Read the numbers a, b, c • Step 3 Compute the sum of a, b and c • Step 4 Divide the sum by 3 • Step 5 Store the result in variable d • Step 6 Print the value of d • Step 7 End
  • 13. Example 2 : Write an algorithm to calculate the simple interest using the formula. Simple interest = P*N* R/100. Where P is principle Amount, N is the number of years and R is the rate of interest. Step 1: start Step 2 : Read the three input quantities’ P, N and R. Step 3 : Calculate simple interest as Simple interest = P* N* R/100 Step 4: Print simple interest. Step 5: Stop.
  • 14. Example: Write an algorithm to calculate the perimeter and area of rectangle. Given its length and width. Step 1: start Step 2: Read length of the rectangle. Step 3: Read width of the rectangle. Step 4: Calculate perimeter of the rectangle using the formula perimeter = 2* (length + width) Step 5: Calculate area of the rectangle using the formula area = length *width. Step 6: Print perimeter. Step 7: Print area. Step 8: Stop.
  • 15. Questions : write algorithm and program 1) The distance between two cities(in km) is input through the keyboard. Write an algorithm and program to convert and print this distance in meters, feet, inches and centimeters 2) Two numbers are input through the keyboard into locations C and D. write an algorithm and program to interchange the contents of C and D 3) Write an algorithm to find whether the number is even or odd. 4) Write an algorithm to print whether the 5) Write an algorithm to print sum, mult, sub, div of two numbers 6) Write an algorithm to calculate simple interest. 7) Write an algorithm to read 3 numbers from the user. Print their sum and average. 8) Write an algorithm to read basic salary from the user and compute HRA – 12% of basic, DA- 64% of basic, allowance -15% of basic. Also display total salary. 9) Write an algorithm to find area and perimeter of square 10) Write an algorithm to find area and perimeter of circle 11) Write an algorithm to find area of triangle using hero’s formula
  • 16. Algorithm design: Problem solving approach (top down/bottom up approach)
  • 17. • A programming approach is nothing but way of solving the computational problem. • Two approaches: a) Top down b) Bottom up
  • 18. Top down approach • “top down” approach is nothing but resolving the problem from high level to low level. Basically you start from the whole problem. • Top down : 1) Take the whole problem and split it into two or more parts. 2) Find solution to these parts. 3) If these parts turn out to be too big to be solved as a whole, split them further and find find solutions to those sub-parts. 4) Merge solutions according to the sub-problem hierarchy thus created after all parts have been successfully solved.
  • 19. Bottom up approach • In "bottom up" approach, you identify lower-level tools that you can compose to become a bigger program. Basically you focus on parts of the problem to solve it. • Bottom up : 1) Breaking the problem into smallest possible(and practical) parts. 2) Finding solutions to these small sub-problems. 3) Merging the solutions you get iteratively(again and again) till you have merged all of them to get the final solution to the "big" problem. The main difference in approach is splitting versus merging. You either start big and split "down" as required or start with the smallest and merge your way "up" to the final solution.
  • 20. Program structure in top down Vs bottom up approach
  • 22. Role of sub algorithm • Algorithms are often broken down into smaller chunks, called Subalgorithm. This is both so that they are easier to read, and also because then parts of the algorithm can be reused. • A sub-algorithm is an algorithmic module which is complete in itself and has independent existence. • It can be used or called by some main algorithm or by some other sub-algorithm. • It may or may not receive values from a calling algorithm. These values are called arguments or parameters. • The sub-algorithm performs its task and then sends back the result to the calling algorithm. It can be called by many different algorithms or called at different places in the same algorithm. • The relationship between an algorithm and a sub-algorithm is similar to the relationship between a main program (function) and a sub-program (sub-function) in a programming language.
  • 23. Usefulness • When the problem is very complex, it is divided into several independent sub-problems. Each sub-problem is called sub-algorithm and can be developed independently. These sub-problems can be combined together to form the solution for the entire problem. Thus by using sub-algorithms the complex problems can be solved easily.
  • 24. Questions 1) C follows top down or bottom up approach? Why? 2) Give names of programming language which follows top down and bottom up approach. 3) What is the role of subalgorithm? What is relationship between main algorithm and sub algorithm?
  • 25. Assignment: write algorithm 1) The current year and the year in which the employee joined the organization are entered through the keyboard. If the number of years for which the employee has served the organization is greater than 3 then a bonus of Rs. 2500/- is given to the employee. If the years of service are not greater than 3, then the program should do nothing. 2) In a company an employee is paid as under: If his basic salary is less than Rs. 1500, then HRA = 10% of basic salary and DA = 90% of basic salary. If his salary is either equal to or above Rs. 1500, then HRA = Rs. 500 and DA = 98% of basic salary. If the employee's salary is input through the keyboard write a program to find his gross salary. 3) The marks obtained by a student in 5 different subjects are input through the keyboard. The student gets a division as per the following rules: Percentage above or equal to 60 - First division Percentage between 50 and 59 - Second division Percentage between 40 and 49 - Third division Percentage less than 40 - Fail calculate the division obtained by the student.
  • 26. 4) Calculate salary 5) If the ages of Ram, Shyam and Ajay are input through the keyboard. determine the youngest of the three. 6) Two numbers are input through the keyboard into locations C and D. write an algorithm and program to interchange the contents of C and D 7)Write an algorithm to find whether the number is even or odd. 8) Write algorithm to check whether a triangle is valid or not, when the three angles of the triangle are entered through the keyboard. A triangle is valid if the sum of all the three angles is equal to 180 degrees.
  • 27. 7) A company insures its drivers in the following cases: − - If the driver is married. - If the driver is unmarried, male & above 30 years of age. - If the driver is unmarried, female & above 25 years of age. 8) Any integer is input through the keyboard. find out whether it is an odd number or even number. 9) Any year is input through the keyboard. Determine whether the year is a leap year or not. (Hint: Use the % (modulus) operator)
  • 28. Unit 1  Flowchart: Elements, Identifying and understanding input/ output, Branching and iteration in flowchart  Algorithm design: Problem solving approach(top down/bottom up approach)  Pseudo Code : Representation of different construct, writing pseudo-code from algorithm and flowchart
  • 49. Unit 1  Flowchart: Elements, Identifying and understanding input/ output, Branching and iteration in flowchart  Algorithm design: Problem solving approach(top down/bottom up approach)  Pseudo Code : Representation of different construct, writing pseudo-code from algorithm and flowchart
  • 52. Like flowcharting, there are many elements to pseudocode design, only the most rudimentary are described here. Get used to get information from the user Display used to display information for the user Compute perform an arithmetic operation + - * Standard arithmetic operators / = ( ) Store Store a piece of information for later use