top of page
Writer's pictureStrofl

What is Algorithm? | Beginner Guide - Qpidi

You use algorithms every day, perhaps without even realizing it! When you follow a recipe to bake a cake, decide the fastest route to work, or even choose what to wear based on the weather – you're using an algorithm.


Algorithm - A way to solve problems
Algorithm - A way to solve problems

What is Algorithm?

Think of an algorithm as a recipe for doing something. It's a step-by-step guide to completing a task or solving a problem.


Everyday Example of an Algorithm

Let's create a simple algorithm for a daily task.


Brushing your teeth


  1. Step 1. Start: This is where you begin the process.

  2. Step 2. Go to the Bathroom: Move to the location where you brush your teeth.

  3. Step 3. Take a Toothbrush: Pick up your toothbrush.

  4. Step 4. Apply Toothpaste: Squeeze a small amount of toothpaste onto the toothbrush.

  5. Step 5. Brush Teeth: Move the toothbrush in circular motions inside your mouth, making sure to clean all surfaces of your teeth.

  6. Step 6. Rinse Mouth: Use water to clean your mouth after brushing.

  7. Step 7. End: Your teeth are clean, and the process is complete.


Add Two Number and Print Total


  1. Step 1. Start: This is where you begin the process.

  2. Step 2. Input First Number (a): Ask the user to input the first number. This will be referred to as a.

  3. Step 3. Store First Number: Save the first number entered by the user.

  4. Step 4. Input Second Number (b): Ask the user to input the second number. This is referred to as b.

  5. Step 5. Store Second Number: Save the second number entered by the user.

  6. Step 6. Add Numbers: Calculate the sum of the two numbers (a + b) and store this in a new variable, let's call it total.

  7. Step 7. Print Total Value: Display the value of total to the user, showing the result of the addition.

  8. Step 8. End: The process is complete, and the final sum has been displayed to the user.


5 views0 comments

Comments

Rated 0 out of 5 stars.
No ratings yet

Add a rating
bottom of page