0% found this document useful (0 votes)
2K views10 pages

Algorithm and Flowchart To Convert A Number From °celsius To °fahrenheit

The document provides algorithms and code for converting Celsius to Fahrenheit, finding the roots of a quadratic equation, and generating a Fibonacci series. The Celsius to Fahrenheit conversion algorithm takes in a Celsius temperature, uses the formula F = (9C/5) + 32 to calculate Fahrenheit, and prints out the result. The quadratic equation root finding algorithm calculates the determinant, checks if it is positive or zero to determine the number and type of roots, and uses formulas to calculate and print the real and/or complex roots. The Fibonacci series algorithm initializes variables, takes in the number of terms, uses a loop to calculate each term as the sum of the previous two, and prints the results

Uploaded by

Sai Preetham
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2K views10 pages

Algorithm and Flowchart To Convert A Number From °celsius To °fahrenheit

The document provides algorithms and code for converting Celsius to Fahrenheit, finding the roots of a quadratic equation, and generating a Fibonacci series. The Celsius to Fahrenheit conversion algorithm takes in a Celsius temperature, uses the formula F = (9C/5) + 32 to calculate Fahrenheit, and prints out the result. The quadratic equation root finding algorithm calculates the determinant, checks if it is positive or zero to determine the number and type of roots, and uses formulas to calculate and print the real and/or complex roots. The Fibonacci series algorithm initializes variables, takes in the number of terms, uses a loop to calculate each term as the sum of the previous two, and prints the results

Uploaded by

Sai Preetham
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 10

algorithm and flowchart to convert a

number from °Celsius to °Fahrenheit


• Algorithm
Step1 Start
Step2 Read the input of temperature in Celsius
(say C)
Step3 F=(9*C)/5+32
Step4 Print temperature in fahrenheit is F
Step5 Stop
Flowchart
//C program to convert Celsius to Fahrenheit

•#include <stdio.h>

•int main()
•{
• float celsius, fahrenheit;

• printf("Please Enter temperature in Celsius: \n");
• scanf("%f", &celsius);

• // Convert the temperature from celsius to fahrenheit
• fahrenheit = ((celsius * 9)/5) + 32;
• // fahrenheit = ((9/5) * celsius) + 32;
• // fahrenheit = ((1.8 * celsius) + 32;

• printf("\n %f Celsius = %f Fahrenheit", celsius, fahrenheit);

• return 0;
•}

An algorithm to find the root of quadratic
equation.
1. Start
2. Enter the value of a, b and c.
3. Calculate determinant as D= b2-4ac
4. If (D> 0) then continue else ‘GOTO Step 9
5. Calculate root1= -b + √D/2a
6. Calculate root2= -b – √D/2a
7. Print value of root1 and root2 these are Real and different
8. GOTO END
9. If (D==0) then continue else GOTO Step 13
10. Calculate root1 = root2 = -b/2*a
11. Print value of root1 and root2 the roots are real and equal.
12. GOTO END
13. Calculate RealPart = -b/2a
14. 14.Calculate imaginaryPart = √(-D)/2a
15. Print value of root1= RealPart + i imaginaryPart
16. Print value of root2= RealPart – i imaginaryPart the roots are complex and
different
17. 17.END
Fibonacci Series Algorithm:

1. Start
2. Declare variables i, a,b , show
3. Initialize the variables, a=0, b=1, and show =0
4. Enter the number of terms of Fibonacci series to be printed
5. Print First two terms of series
6. Use loop for the following steps
-> show=a+b
-> a=b
-> b=show
-> increase value of i each time by 1
-> print the value of show
7. End
Source code

You might also like