0% found this document useful (0 votes)
4 views12 pages

Chapter - 2 Algorithm and Flowchart

Hello World Institute offers training in algorithms and flowcharts, emphasizing practical learning through real-time projects and case studies. The document outlines various algorithms for everyday problems, programming tasks, and includes flowchart basics for visual representation of processes. Contact information and class options (offline and online) are also provided.

Uploaded by

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

Chapter - 2 Algorithm and Flowchart

Hello World Institute offers training in algorithms and flowcharts, emphasizing practical learning through real-time projects and case studies. The document outlines various algorithms for everyday problems, programming tasks, and includes flowchart basics for visual representation of processes. Contact information and class options (offline and online) are also provided.

Uploaded by

hey867044
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Hello World Institute

Why learn with us ?

Training From Experts One - on – One Guidance 100% Practical

Real-Time Projects & Case Studies Placement Preparation

OFFLINE CLASSES ONLINE LECTURE RECORDED ACCESS

Contact :- 8085896740 @ hello_world_institute Hello World Institute


Address : 2nd Floor , Near KFC , Tower Square , Bhawarkua , Indore
Hello World Institute

Algorithm and Flowchart

Algorithm :- A step-by-step process or set of instructions to solve any problem is called an


algorithm.

Examples of Problems :- Real-life Problem, Programming Problem, Mathematical Problem, Data


Science Problem.

Real-life Problem:

 Making a cup of tea

 Following a recipe to cook food

 Finding the fastest route to school or office

Contact :- 8085896740 @ hello_world_institute Hello World Institute


Address : 2nd Floor , Near KFC , Tower Square , Bhawarkua , Indore
Hello World Institute

Algorithm: Making a Cup of Tea

Step 1: Take a container (kettle or pan).

Step 2: Add water to the container.

Step 3: Add milk to the container (optional, as per taste).

Step 4: Place the container on gas or stove and turn it on.

Step 5: Add sugar (optional) into the container.

Step 6: Add tea leaves or tea bag into the container.

Step 7: Let the mixture boil for 3–5 minutes.

Step 8: Turn off the gas/stove.

Step 9: Pour the tea into a cup using a strainer (if using tea leaves).

Step 10: Serve hot.

Contact :- 8085896740 @ hello_world_institute Hello World Institute


Address : 2nd Floor , Near KFC , Tower Square , Bhawarkua , Indore
Hello World Institute

Programming Problem:

 Sorting a list of numbers


 Searching for a word in a text
 Creating a login system for a website

Some simple Algorithm for practice :-

Algorithm: Adding Two Numbers

Step 1: Declare containers a, b, c.


Step 2: Input a = 12, b = 5.
Step 3: Compute c = a + b.
Step 4: Display c.

Algorithm: Subtracting Two Numbers

Step 1: Declare containers a, b, c.


Step 2: Input a = 12, b = 5.

Contact :- 8085896740 @ hello_world_institute Hello World Institute


Address : 2nd Floor , Near KFC , Tower Square , Bhawarkua , Indore
Hello World Institute

Step 3: Compute c = a - b.
Step 4: Display c.

Algorithm: Area of a Rectangle

Step 1: Declare containers length, width, area.


Step 2: Input length and width.
Step 3: Compute area = length × width.
Step 4: Display area.

Algorithm: Area of a Circle

Step 1: Declare containers radius, area.


Step 2: Input radius.
Step 3: Compute area = 3.141 × radius × radius.
Step 4: Display area.

Contact :- 8085896740 @ hello_world_institute Hello World Institute


Address : 2nd Floor , Near KFC , Tower Square , Bhawarkua , Indore
Hello World Institute

Here’s a list of practice algorithm questions only:-

1. Find the sum of two numbers.

2. Find the difference of two numbers.

3. Find the product of two numbers.

4. Find the area of a triangle.

5. Find the area of a square.

6. Calculate square of a number.

7. Calculate cube of a number.

8. Calculate simple interest.

breakdown of an algorithm into four main parts :-

Contact :- 8085896740 @ hello_world_institute Hello World Institute


Address : 2nd Floor , Near KFC , Tower Square , Bhawarkua , Indore
Hello World Institute

1️⃣ Input

 Definition: Input is the data or values provided to the algorithm, usually by the user.
 Example: Numbers, text, or decimal values that the user enters.
o Example values: 12 (integer), 45.67 (decimal), "Indore" (string/text)

2️⃣ Operation

 Definition: Operations are the steps or calculations performed on the input to process it.
 Example: Adding two numbers, calculating area, squaring a number, or converting units.

3️⃣ Control Flow

 Definition: Control flow determines the order in which operations are executed and may
include decisions or loops.

4️⃣ Output

 Definition: Output is the result produced by the algorithm after processing the input.
 Example: Displaying the sum, area, result, or message to the user.
o Examples: 57 (sum of 12 + 45), 78.5 (area of rectangle), "Hello, Indore!"

Contact :- 8085896740 @ hello_world_institute Hello World Institute


Address : 2nd Floor , Near KFC , Tower Square , Bhawarkua , Indore
Hello World Institute

Algorithm: Check Voter Eligibility

Step 1: Declare container age.


Step 2: Input age = 25.
Step 3: Condition → Check if (age >= 18).
Step 4: If condition is true, print "Eligible to vote".
Step 5: If condition is false, print "Not eligible to vote".

Algorithm: Check Positive or Negative Number

Step 1: Declare container number.


Step 2: Input number = -7.
Step 3: Condition → Check if (number >= 0).
Step 4: If the condition (number >= 0) is true, then print "The number is Positive".
Step 5: If the condition (number >= 0) is false, then print "The number is Negative".

Contact :- 8085896740 @ hello_world_institute Hello World Institute


Address : 2nd Floor , Near KFC , Tower Square , Bhawarkua , Indore
Hello World Institute

Flowchart :- A flowchart is a graphical, diagrammatic, or block representation of a

programming problem or an algorithm.

Some shapes which is used to make flowchart :-

1. Oval / Ellipse – Start / End

Purpose: Shows the beginning and ending of a process or algorithm.

Start Stop

2. Parallelogram – Input / Output

Purpose: Used for taking input from the user or displaying output.

Input Output

Contact :- 8085896740 @ hello_world_institute Hello World Institute


Address : 2nd Floor , Near KFC , Tower Square , Bhawarkua , Indore
Hello World Institute

3. Rectangle – Process / Operation

Purpose: Represents a step, calculation, or action (like addition, assignment).

Operation C=A+B

4. Diamond – Decision / Condition

Purpose: Used for conditions or yes/no decisions.

Condition age>=18

Contact :- 8085896740 @ hello_world_institute Hello World Institute


Address : 2nd Floor , Near KFC , Tower Square , Bhawarkua , Indore
Hello World Institute

5. Arrow – Flow Direction

Purpose: Shows the order of steps or the flow of control.

6. Connector (Circle) – Connector / Jump

Purpose: Used to connect different parts of a flowchart when space is limited.

Contact :- 8085896740 @ hello_world_institute Hello World Institute


Address : 2nd Floor , Near KFC , Tower Square , Bhawarkua , Indore
Hello World Institute

Some Flowchart Example:-

Check Voter Eligibility :-

Start

declaire age

age=12

true false
“eligible” age>=18 “not eligible”

Stop

Contact :- 8085896740 @ hello_world_institute Hello World Institute


Address : 2nd Floor , Near KFC , Tower Square , Bhawarkua , Indore

You might also like