1.

Write an algorithm to convert temperature from Celsius to Fahrenheit

Answer»

The algorithm for the conversion of temperature from Fahrenheit to Celsius is as follows:

  1. Read the temperature given in degree Fahrenheit.
  2. Convert the temperature in Fahrenheit into Celsius using the formula : C=5/9*(F-32)
  3. Print the Fahrenheit and Celsius value of temperature.
  4. End

The code for the same is -

# include < stdio . h >

# include < conio . h >

void main (  )

{

         float    a , b ;

         clr scr( ) ;

         printf(" Fahrenheit: ");

         scanf("%f", & b );

         a = ( b - 32 ) * ( 5 / 9 ) ;

         printf(" \ n \ t % . 2b Fahrenheit = % . 2b Centigrade " , b , a ) ;

    



Discussion

No Comment Found