0% found this document useful (0 votes)
36 views

Algorithms_and_Flowcharts_with_Images

The document outlines three algorithms: one for calculating the square root of a number, another for finding the average of ten random numbers, and a third for summing all odd numbers between 0 and 50. Each algorithm includes a step-by-step description and a corresponding flowchart description. The flowcharts visually represent the processes involved in each algorithm.

Uploaded by

osarienjoseph
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)
36 views

Algorithms_and_Flowcharts_with_Images

The document outlines three algorithms: one for calculating the square root of a number, another for finding the average of ten random numbers, and a third for summing all odd numbers between 0 and 50. Each algorithm includes a step-by-step description and a corresponding flowchart description. The flowcharts visually represent the processes involved in each algorithm.

Uploaded by

osarienjoseph
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/ 5

Algorithms and Flowchart Descriptions

1. Algorithm to Find the Square Root of a Number

Step 1: Start
Step 2: Input the number N
Step 3: Set an initial guess x = N / 2
Step 4: Repeat the following until the result is accurate enough:
x = (x + N / x) / 2
Step 5: Output the value of x
Step 6: Stop

Flowchart Description:

1. Start
2. Input N
3. Initialize x = N / 2
4. Loop until error is small (e.g., difference between x and N/x is small)
→ x = (x + N / x) / 2
5. Output x
6. End

2. Algorithm to Find the Average of 10 Random Numbers

Step 1: Start
Step 2: Initialize sum = 0 and count = 0
Step 3: Repeat the following steps 10 times:
a. Generate a random number num
b. Add num to sum
c. Increment count by 1
Step 4: Compute average = sum / count
Step 5: Display average
Step 6: Stop

Flowchart Description:

1. Start
2. Initialize sum = 0, count = 0
3. Loop (Repeat 10 times):
- Generate random number num
- Add num to sum
- Increment count
4. Compute average = sum / count
5. Display average
6. Stop

3. Algorithm to Find the Sum of All Odd Numbers Between 0 and 50

Step 1: Start
Step 2: Initialize sum = 0
Step 3: Set i = 1
Step 4: While i < 50, do
a. Add i to sum
b. Increment i by 2 (to get the next odd number)
Step 5: Display sum
Step 6: Stop

Flowchart Description:

1. Start
2. Initialize sum = 0, i = 1
3. Check condition: Is i < 50?
- If YES:
• sum = sum + i
•i=i+2
• Repeat the check
- If NO:
• Go to next step
4. Display sum
5. Stop
Flowchart Diagrams

1. Square Root Flowchart


2. Average of 10 Numbers Flowchart
3. Sum of Odd Numbers Flowchart

You might also like