Algorithms_and_Flowcharts_with_Images
Algorithms_and_Flowcharts_with_Images
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
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
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