0% found this document useful (0 votes)
3 views

Algo Flowchart

Uploaded by

Manan Desai
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

Algo Flowchart

Uploaded by

Manan Desai
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 15

Introduction to

Problem Solving
Skills
Agenda
• Algorithms
• Flowcharts
Algorithms
• In computer science, an algorithm is a finite sequence of well-defined,
computer-implementable instructions, typically to solve a class of problems or
to perform a computation.
• Algorithms are always unambiguous and are used as specifications for
performing calculations, data processing, automated reasoning, and other
tasks.
• An algorithm can be expressed within a finite amount of space and time, and
in a well-defined formal language for calculating a function.
• Starting from an initial state and initial input (perhaps empty), the instructions
describe a computation that, when executed, proceeds through a finite
number of well-defined successive states, eventually producing "output" and
terminating at a final ending state.
How to write algorithm?
• Natural language
• Flowcharts
• Programming language
• Pseudo code notations
Why study algorithms?
• Is computer an intelligent device?
• No.
• We have to provide step by step description of the operation to be
performed i. e. algorithm for the operation.
Algorithm-Natural Language
Construct Description

Assignment. For example B Y*7 means B will


have the value of Y*7
Read For taking input
Print For displaying output
Start For beginning the algorithm steps

End For stopping the algorithm steps to make it a finite


algorithm

if <condition> then <statement> For conditional statement


else <statement>
Go to step n For moving to step n
Repeat For repeating a set of statements/instructions
Example
Calculation of Simple Interest
• Print larger of two numbers
• Print first n natural numbers
Flowcharts
• Defined as a diagram which visually presents the flow of data through
processing systems.
• Flowchart can be used for representing an algorithm.
• It describes the operations (and in what sequence) that are required
to solve a given problem.
Example
• Draw flowchart for calculation of simple interest.
• Draw flowchart to print larger of two numbers
• Draw flowchart to print first n natural numbers
• Draw a Flowchart and Write an algorithm for the following
1. To display the “Welcome” Message.
2. To perform the addition of two numbers.
3. To calculate the area of the right angle triangle.
4. To check whether a given number is even or odd.
5. To check for the largest among the three numbers.
6. To check whether a given year is a leap year or not.
7. To find the roots of a quadratic equation.
8. To display the table of N.
9. To find and display the sum of the first N numbers.
10. To check whether a given number is prime or not.
11. To display the first 5- prime number.

You might also like