You are on page 1of 4

Bataan Peninsula State University

Main Campus
Capitol Drive, City of Balanga, Bataan
College of Engineering and Architecture

Custodio, Ashlhey C, BSCE- SE 1A (GEC_CEA7) ICTE0112

1. Algorithm:
Step 1: Start

Step 2: Reads in two values a and b

Step 3: Using the comparison operator, check if a is greater or b is greater. If a is

greater, display a is greater, otherwise, b is greater.

Step 4: Stop

Flowchart:

No Yes

1
Bataan Peninsula State University
Main Campus
Capitol Drive, City of Balanga, Bataan
College of Engineering and Architecture

2. Algorithm

Step 1: Start

Step 2: Input the value of radius R

Step 3: Calculate area=PI*R*R

Step 4: Show the value of area

Step 6: Stop

Flowchart:

2
Bataan Peninsula State University
Main Campus
Capitol Drive, City of Balanga, Bataan
College of Engineering and Architecture

3. Algorithm:

Step 1: Start

Step 2: Declare variables num1, num2 and sum.

Step 3: Read values for num1, num2.

Step 4: Add num1 and num2 and assign the result to a variable sum.

Step 5: Display sum

Step 6: Stop

Flowchart:

No

Yes

3
Bataan Peninsula State University
Main Campus
Capitol Drive, City of Balanga, Bataan
College of Engineering and Architecture

4. Algorithm:

Step 1: Start

Step 2: Read the three numbers to be compared, as A, B and C.

Step 3: Check if A is greater than B.

• If true, then check if A is greater than C.


• If true, print 'A' as the greatest number.
• If false, print 'C' as the greatest number.

• If false, then check if B is greater than C.


• If true, print 'B' as the greatest number.
• If false, print 'C' as the greatest number.

Step 4: Stop

Flowchart:

No Yes

No No

Yes Yes

You might also like