Algorithms & Flowcharts (10 Programs)
Every problem follows a systematic solution path: Problem Definition → Algorithm → Flowchart → C Source Code. Step through all 10 lab manual experiments interactively below!
Standard Flowchart Symbols
| Symbol | Shape | Purpose & Description |
|---|---|---|
| Terminal | Capsule / Oval | Start or Stop point of execution |
| Input / Output | Parallelogram | Reading input (`scanf`) or Printing output (`printf`) |
| Process | Rectangle | Calculations, formula evaluation, assignments |
| Decision | Diamond | Conditional check (`if-else`) with Yes / No paths |
| Connector | Circle | Joins flowchart lines from different paths |
| Flow Line | Arrow Line | Shows exact direction of CPU execution |
Interactive Symbol Inspector
Click on a flowchart shape below to inspect its exact C programming mapping:
To Multiply Two Numbers
Accept two integers a and b, compute their product product = a × b, and display the result.
Algorithm Steps
- Step 1: Start
- Step 2: Read integers
aandb - Step 3: Compute
product = a * b - Step 4: Display
product - Step 5: Stop
Detailed Flowchart Diagram
To Divide Two Numbers (With Decision Branching)
Read numerator a and denominator b. Test b != 0 with YES (True) and NO (False) flowchart decision branches.
Algorithm Steps
- Step 1: Start
- Step 2: Read integers
aandb - Step 3: If
b == 0then Print "Division by Zero Error" andgoto Step 6 - Step 4: Compute
quotient = (float)a / b - Step 5: Display
quotient - Step 6: Stop
Detailed Decision Flowchart
To Check Even or Odd (Two Branch Flowchart)
Evaluate n % 2 == 0. Follow YES branch for Even and NO branch for Odd.
Algorithm Steps
- Step 1: Start
- Step 2: Read integer
n - Step 3: If
n % 2 == 0then Print "Number is Even" andgoto Step 6 - Step 4: Print "Number is Odd"
- Step 5: Stop
Detailed Decision Flowchart
To Swap Two Numbers
Exchange values of a and b using temporary variable temp.
Algorithm Steps
- Step 1: Start
- Step 2: Read integers
aandb - Step 3: Assign
temp = a - Step 4: Assign
a = b - Step 5: Assign
b = temp - Step 6: Display swapped values of
aandb - Step 7: Stop
Detailed Flowchart Diagram
To Check Whether Number is < 10
Evaluate n < 10. Follow YES branch if <10 and NO branch if ≥10.
Algorithm Steps
- Step 1: Start
- Step 2: Read integer
n - Step 3: If
n < 10then Print "Lesser than 10" andgoto Step 5 - Step 4: Print "Not lesser than 10"
- Step 5: Stop
Detailed Decision Flowchart
To Convert Fahrenheit to Celsius
Convert temperature from Fahrenheit to Celsius using formula: C = (F − 32) × 5/9.
Algorithm Steps
- Step 1: Start
- Step 2: Read temperature in Fahrenheit
F - Step 3: Compute Celsius
C = (F - 32) * 5 / 9 - Step 4: Display temperature in Celsius
C - Step 5: Stop
Detailed Flowchart Diagram
To Check Greater of Two Numbers
Evaluate a > b. Follow YES branch if a > b and NO branch if b ≥ a.
Algorithm Steps
- Step 1: Start
- Step 2: Read integers
aandb - Step 3: If
a > bthen Print "a is Greater" andgoto Step 5 - Step 4: Print "b is Greater"
- Step 5: Stop
Detailed Decision Flowchart
To Calculate Simple Interest
Calculate simple interest SI = (P × R × T) / 100.
Algorithm Steps
- Step 1: Start
- Step 2: Read Principal
P, RateR, and TimeT - Step 3: Compute Simple Interest
SI = (P * R * T) / 100 - Step 4: Display
SI - Step 5: Stop
Detailed Flowchart Diagram
To Check Whether Given Number is Prime
Interactive algorithm and flowchart to determine if an integer is prime using trial division up to n / 2.
Algorithm Steps
- Step 1: Start
- Step 2: Read integer
n - Step 3: If
n < 2then Print "Not Prime" andgoto Step 8 - Step 4: Initialize loop counter
i = 2 - Step 5: If
i > n / 2then Print "Prime Number" andgoto Step 8 - Step 6: If
n % i == 0then Print "Not Prime" andgoto Step 8 - Step 7: Increment
i = i + 1andgoto Step 5 - Step 8: Stop
Prime Number Flowchart
To Calculate Area of Rectangle
Given length (L) and breadth (B), compute rectangle area: Area = L × B.
Algorithm Steps
- Step 1: Start
- Step 2: Read length
Land breadthB - Step 3: Compute
Area = L * B - Step 4: Display
Area - Step 5: Stop