You are on page 1of 18

CHAPTER-2

ALGORITHM
&
FLOWCHARTS
Presented by Computer G
WHAT IS AN ALGORITHM?
In computer programming terms, an algorithm
is a set of well-defined instructions to solve a
particular problem.
The word Algorithm means ”A set of finite rules
or instructions to be followed in calculations or
other problem-solving operations ”
FLOWCHART
A flowchart is a type of diagram that
represents a workflow or process. A flowchart
can also be defined as a diagrammatic
representation of an algorithm, a step-by-step
approach to solving a task.
ADD TWO NUMBERS
ALGORITHM TO ADD TWO NUMBERS
Step 1: Start
Step 2: Declare variables A, B and C.
Step 3: Read values for A, B.
Step 4: Add A and B and assign the result to a
variable C.
Step 5: Display sum
Step 6: Stop
Determining the Largest
Number Among All the
Entered Integers
ALGORITHM

Step 1: Read the Integer A.


Step 2: Read Integer B.
Step 3: Compare A and B
Step 4: If B is greater than A, then print B, else
A.
Determine and Output
Whether Number N is Even
or Odd
ALGORITHM

Step 1: Read number N.


Step 2: Set remainder as N modulo 2.
Step 3: If the remainder is equal to 0, then
number N is even, else number N is odd.
Step 4: Print output.
Calculate the Interest of
a Bank Deposit
ALGORITHM
Step 1: Read amount.
Step 2: Read years.
Step 3: Read rate.
Step 4: Calculate the interest with the formula
"Interest=Amount*Years*Rate/100.
Step 5: Print interest.
THANK
YOU

You might also like