Examples 1
Examples 1
QUADRATIC EQUATION
SOLUTION
QUADRATIC EQUATION
SOLUTION
1. Start
4. Check Discriminant:
- If discriminant > 0:
- Else if discriminant == 0:
- Calculate r = -b / (2a)
5. End
QUADRATIC EQUATION
SOLUTION
Test Cases:
•, ( a=1, b=−5, c=6 ), solution: x=3 and x=2
•, (a = 2 , b = 4 , c = -6) , solution: x=1 and x=−3
• (a = 1 , b = 4 , c = 5) , No solution.
• (a = 1 , b = -6 , c = 9) , only one root.
https://onlinegdb.com/FoUz9pEls
Solve 2 * 2 linear equations
Solve 2 * 2 linear equations
Solution steps:
1. Prompt the user to enter values for a, b, c, d, e, and f.
2. Compute the determinant
3. Check if Determinant is Zero:
- Yes: Output "The equation has no solution" and go to End.
- No: Proceed to the next step.
4. Calculate Values for 𝑥 and 𝑦:
https://onlinegdb.com/7anx6hs2Y
Check ISBN-10
Check ISBN-10
Solution steps:
1. Ask the user to enter the first 9 digits of ISBN.
2. Extract each digit from the given number.
3. Calculate the last digit checksum.
4. Check if the last digit equal to 10, if true add X to last digit, else add the last digit to the
number.
https://onlinegdb.com/VXRa3EG7F
Palindrome number
https://onlinegdb.com/i7x3_yBtZ
Financial: compare costs
https://onlinegdb.com/syNLNYgVk