0% found this document useful (0 votes)
56 views16 pages

4-27TH-JAN-Algorithm & Flowchart

This document discusses algorithms, flowcharts, and their importance in programming. It defines an algorithm as a step-by-step approach to solve a problem and lists its key features. A flowchart is described as the graphical representation of an algorithm using standard symbols. Several examples are given of writing algorithms and drawing corresponding flowcharts to find the sum of two numbers, calculate the area and perimeter of a rectangle, convert temperatures between Fahrenheit and Celsius, and more. The document emphasizes that defining the algorithm and flowchart helps structure the problem-solving approach before writing the actual program code.

Uploaded by

asdfghjkl asd
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
56 views16 pages

4-27TH-JAN-Algorithm & Flowchart

This document discusses algorithms, flowcharts, and their importance in programming. It defines an algorithm as a step-by-step approach to solve a problem and lists its key features. A flowchart is described as the graphical representation of an algorithm using standard symbols. Several examples are given of writing algorithms and drawing corresponding flowcharts to find the sum of two numbers, calculate the area and perimeter of a rectangle, convert temperatures between Fahrenheit and Celsius, and more. The document emphasizes that defining the algorithm and flowchart helps structure the problem-solving approach before writing the actual program code.

Uploaded by

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

Algorithm & Flowchart

Prof. Debashis Hati


Program & Programming
Program A set of instructions which is used to process the
input data and produces the result.

Programming the way of writing program.

What is the requirement?


(1)Studying the syntax and semantics( grammar and meaning) of
a Programming language.
(2)A set of procedure/tools/techniques that help you write a
program
(3)A system with software( os, compiler, editor) is required to
write and execute the program
Algorithm & Flowchart
Before writing a program, to analyze the problem there is a
need of algorithm and flowchart.
Algorithm is a step by step approach to solve a problem.
Features
(1) Finiteness terminates after fixed no of steps.
(2) Definiteness Each step performs the operation without any
ambiguity.
(3) Effectiveness All operations should be basic operations like
addition, subtraction,…,comparison etc.
(4) Input has one or more inputs.
(5) Output has one or more outputs.
Flowchart
Flowchart graphical representation of algorithm.
Symbols used
start / stop Flow direction

Input / output

Processing connector

Decision making
Write an algorithm and flow chart to find the
sum of two numbers.
Algorithm :
1)Start
2)Read / input number1 and number2
3) sumnumber1+number2
4)Print sum
5)Stop
Draw the corresponding flow chart.
Continued..
• Flow chart
start

Read Number1 ,
Number2

Sum=Number1+Number2

Print Sum

stop
Area and perimeter of Rectangle
Algorithm :
1)Start
2)Read / input length and breadth
3)arealength* breadth
4)perimeter2*(length+breadth)
4)Print area, perimeter
5)Stop
Draw the corresponding flow chart.
Area and perimeter of circle
Write algorithm and draw flowchart.
Area and perimeter of a rectangle
Convert a temperature from farenheit
to centigrade
C=5/9( F-32)
Write algorithm and draw flowchart
Find the area of a triangle having
unequal sides a,b,c
• s=(a+b+c)/2
• Area= sqrt(s*(s-a)*(s-b)*(s-c))
• Write algorithm and draw flowchart
Find the maximum of two integers a
and b
• Write algorithm and draw flowchart
Find the maximum of three integers
a,b and c
• Write algorithm and draw flowchart
Find the integer is even or odd
• Write algorithm and draw flowchart
Find the roots of a quadratic
equation ax2+bx+c=0
Algorithm :
1) Start
2) Read / input coefficents a,b and c
3) Discrimant d= b2 – 4ac
4) If (d==0)
Root1=root2= -b/2a
5) If (d>0)
Root1= (-b+sqrt(d))/ 2a
Root2= (-b-sqrt(d))/ 2a
6)Draw the corresponding flow chart.
How algorithm & flowchart help you to write
program??
Algorithm Flow chart Program to be needed
You know the steps? Analyze the problem Scanf(“”%d%d”,&No1,&No2)
1. Read No1, No2
2.
Read No1,No2
3.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy