0% found this document useful (0 votes)
23 views10 pages

Algorithm and Flowcharts Sums

The document contains algorithms and flowcharts for various mathematical operations including checking if a number is positive, negative, or zero; summing two numbers; converting Celsius to Fahrenheit; calculating the area and perimeter of squares and rectangles; finding the square and cube of a number; determining the largest number among two integers; finding the highest common factor (HCF) of two integers; and calculating bank interest. Each algorithm is presented with a step-by-step process followed by a corresponding flowchart. These algorithms serve as foundational programming exercises for beginners.

Uploaded by

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

Algorithm and Flowcharts Sums

The document contains algorithms and flowcharts for various mathematical operations including checking if a number is positive, negative, or zero; summing two numbers; converting Celsius to Fahrenheit; calculating the area and perimeter of squares and rectangles; finding the square and cube of a number; determining the largest number among two integers; finding the highest common factor (HCF) of two integers; and calculating bank interest. Each algorithm is presented with a step-by-step process followed by a corresponding flowchart. These algorithms serve as foundational programming exercises for beginners.

Uploaded by

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

1) Write an algorithm and draw a flowchart to check whether given number is +ve, -ve or

zero.

ALGORITHM
Step 1: Start
Step 2: Take any number and store it in X.
Step 3: Check n value, if X < 0 then go to step 5 else go to step 4
Step 4: Check n value, if X > 0 then go to step 6 else go to step 7
Step 5: Print “Given number is -ve” and go to step 8
Step 6: Print “Given number is +ve” and go to step 8
Step 7: Print “Given number is zero” Step 8: Stop

FLOWCHART START

Input Number X

YES PRINT “The given


IF X < 0 number is –ve”

NO

NO
IF X > 0

YES

PRINT “The given PRINT “The given


number is +ve” number is ZERO”

STOP
2) Write an algorithm and draw a flowchart to find the sum of two numbers

ALGORITHM
Step-1 Start
Step-2 Input first number A
Step-3 Input second number B
Step-4 SUM = A + B
Step-5 Display SUM
Step-6 Stop

FLOWCHART
START

INPUT A

INPUT B

SUM = A + B

PRINT SUM

STOP
3) Write an algorithm and draw a flowchart to convert temperature from Celsius to
Fahrenheit
C: temperature in Celsius
F: temperature Fahrenheit

ALGORITHM
Step-1 Start
Step-2 Input temperature in Celsius say C

Step-3 F=(C * 9/5) + 32


Step-4 Display Temperature in Fahrenheit F
Step-5 Stop

FLOWCHART
START

INPUT C

F=(C * 9/5) + 32

PRINT F

STOP
4) Write an algorithm and draw a flowchart to find Area and Perimeter of Square
L: Side Length of Square
AREA: Area of Square
PERIMETER: Perimeter of Square

ALGORITHM
Step-1 Start
Step-2 Input Side Length of Square L
Step-3 Area = L x L
Step-4 PERIMETER = 4 x L
Step-5 Display AREA, PERIMETER
Step-6 Stop

FLOWCHART
START

INPUT L

AREA = L * L

PERIMETER = 4 * L

PRINT AREA, PERIMETER

STOP
5) Write an algorithm and draw a flowchart to find Area and Perimeter of Rectangle
L: Length of Rectangle
B: Breadth of Rectangle
AREA: Area of Rectangle
PERIMETER: Perimeter of Rectangle

Algorithm
Step-1 Start
Step-2 Input Side Length & Breadth say L, B
Step-3 Area = L * B
Step-4 PERIMETER = 2 * (L + B)
Step-5 Display AREA, PERIMETER
Step-6 Stop

FLOWCHART
START

INPUT L, B

AREA = L * L

PERIMETER = 2 * ( L + B)

PRINT AREA, PERIMETER

STOP
6) Write an algorithm and draw a flowchart to find Square of a Number
N: Number
S: Square

Algorithm
Step-1 Start
Step-2 Input N
Step-3 Square = N * N
Step-5 Display SQUARE
Step-6 Stop

FLOWCHART
START

INPUT N

SQUARE = N * N

PRINT SQUARE

STOP
7) Write an algorithm and draw a flowchart to find Cube of a Number
N: Number
S: Square

Algorithm
Step-1 Start
Step-2 Input N
Step-3 Cube = N * N * N
Step-4 Display Cube
Step-5 Stop

FLOWCHART
START

INPUT N

CUBE = N * N * N

PRINT CUBE

STOP
8) Write an algorithm and draw a flowchart to determine the largest number among all the
entered integers

A: Number 1

B: Number 2

Algorithm
Step 1: Start
Step 2: Input Integer A.
Step 3: Input Integer B.
Step 4: If B is greater than A, then
Step 5: Print B,
Else A.
Step 5: Stop

FLOWCHART

START

INPUT A, B

NO
IS B > A PRINT A

YES

PRINT B

STOP
9) Write an algorithm and draw a flowchart to determine the Highest Common Factor
(HCF) of two integers

A: Number 1

B: Number 2

Algorithm
Step 1: Start
Step 2: Input Integer A.
Step 3: Input Integer B.
Step 4: If a = b, go to step 6.
Step 5: If a > b, then: a = a - b. Return to step 4.
Step 6: Print A or B.

FLOWCHART

START

INPUT A , B

YES
IS A=B?
PRINT

NO
STOP

YES NO
IS A>B?

A=A-B B=B-A
10) Write an algorithm and draw a flowchart to calculate the Interest of a Bank Deposit

A: Amount
Y: Years
R: Rate of Interest
I: Interest
Algorithm
Step 1: Start
Step 2: Input amount.
Step 3: Input years.
Step 4: Input rate.
Step 5: Calculate the interest with the formula "Interest=Amount*Years*Rate/100.
Step 6: Print interest.
Step 7: Stop

START
FLOWCHART

INPUT A

INPUT Y

INPUT R

I = A * R * Y / 100

PRINT I

STOP

You might also like