Write algorithm and flowchart for the following.1. Find the largest among three different numbers entered by the user.2. Find all the roots of a quadratic equation ax 2+bx+c=03. Find the Fibonacci series till term ≤ 1000.4. Determine whether a Temperature is below or above the Freezing Point5. Determine whether a student Passed the exam or not6. Find sum of all even numbers upto n7. Find product of numbers upto n8. Interchange the value of two numbers9. Find area and perimeter of square.10. Find sum of digits of an accepted number
Question
Write algorithm and flowchart for the following.1. Find the largest among three different numbers entered by the user.2. Find all the roots of a quadratic equation ax 2+bx+c=03. Find the Fibonacci series till term ≤ 1000.4. Determine whether a Temperature is below or above the Freezing Point5. Determine whether a student Passed the exam or not6. Find sum of all even numbers upto n7. Find product of numbers upto n8. Interchange the value of two numbers9. Find area and perimeter of square.10. Find sum of digits of an accepted number
Solution
Sure, here are the algorithms for the tasks you mentioned:
- Find the largest among three different numbers entered by the user.
Algorithm:
Step 1: Start
Step 2: Input numbers (a, b, c)
Step 3: If a > b and a > c, then print a is largest
Step 4: Else if b > a and b > c, then print b is largest
Step 5: Else print c is largest
Step 6: End
- Find all the roots of a quadratic equation ax^2+bx+c=0
Algorithm:
Step 1: Start
Step 2: Input values of a, b, c
Step 3: Calculate discriminant (d = b^2 - 4ac)
Step 4: If d < 0, print "No real roots"
Step 5: Else if d = 0, calculate root (-b/2a) and print it
Step 6: Else calculate roots ((-b + sqrt(d))/2a and (-b - sqrt(d))/2a) and print them
Step 7: End
- Find the Fibonacci series till term ≤ 1000.
Algorithm:
Step 1: Start
Step 2: Initialize variables (a = 0, b = 1)
Step 3: While a ≤ 1000, print a and update a and b (temp = a, a = b, b = temp + b)
Step 4: End
- Determine whether a Temperature is below or above the Freezing Point
Algorithm:
Step 1: Start
Step 2: Input temperature (t)
Step 3: If t < 0, print "Below freezing point"
Step 4: Else print "Above freezing point"
Step 5: End
- Determine whether a student Passed the exam or not
Algorithm:
Step 1: Start
Step 2: Input student's score (s)
Step 3: If s ≥ passing score, print "Passed"
Step 4: Else print "Failed"
Step 5: End
- Find sum of all even numbers upto n
Algorithm:
Step 1: Start
Step 2: Input n
Step 3: Initialize sum = 0
Step 4: For i = 2 to n, if i is even, add i to sum
Step 5: Print sum
Step 6: End
- Find product of numbers upto n
Algorithm:
Step 1: Start
Step 2: Input n
Step 3: Initialize product = 1
Step 4: For i = 1 to n, multiply product by i
Step 5: Print product
Step 6: End
- Interchange the value of two numbers
Algorithm:
Step 1: Start
Step 2: Input numbers (a, b)
Step 3: Swap a and b (temp = a, a = b, b = temp)
Step 4: Print a and b
Step 5: End
- Find area and perimeter of square.
Algorithm:
Step 1: Start
Step 2: Input side length (s)
Step 3: Calculate area (s^2) and perimeter (4s)
Step 4: Print area and perimeter
Step 5: End
- Find sum of digits of an accepted number
Algorithm:
Step 1: Start
Step 2: Input number (n)
Step 3: Initialize sum = 0
Step 4: While n > 0, add last digit of n to sum and remove last digit from n
Step 5: Print sum
Step 6: End
Please note that these are simple algorithms and do not include error checking or handling of special cases.
Similar Questions
Draw the flow chart for the following questions.1. check the number is positive or negative.2. check the number is even or odd.3. check to check whether a number is divisible by 5 or not.4. check to check whether a number is divisible by 5 and divisible by 3.5. swap (or exchange) the values of two variables.6. find the largest among three numbers.7. input marks of five subjects Physics, Chemistry, Biology, Mathematics and Computer.Calculate percentage and grade according to following:Percentage >= 90% : Grade APercentage >= 80% : Grade BPercentage >= 70% : Grade CPercentage >= 60% : Grade DPercentage >= 40% : Grade EPercentage < 40% : Grade F
Write a pseudo code + Draw Flowchart that find the biggest of three (3) Numbers
Draw a flowchart to find smallest of the three numbers entered by User
Write down the algorithm for the following questions.a) to calculate the root of a quadratic equation.b) to read the roll no, name and marks of three subjects and calculate the total,percentage and division.c) to check whether a triangle can be formed with the given values for the angles.d) to compute the sum of the first “N” natural numbers.e) to display the multiplication table for a given integer.f) to calculate the factorial of a given number.g) to check whether a given number is an Armstrong number or not.h) to determine whether a given number is prime or not.
e the following flowchart to answer the below two questions 1) and 2).
Upgrade your grade with Knowee
Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.