To Enter Temperature In Centigrade & Display Its Equivalent Fahrenheit

To Enter Temperature In Centigrade & Display Its Equivalent Fahrenheit




#include<stdio.h> /*tells compiler to include std input output file.*/
#include<conio.h>/*tells compilers to provide console input/output*/
     void main()
{     
        
float c, f ;                  /*declaring variables c for Celsius  and f for Fahrenheit */
        float ans;                                /*ans may come in fractions*/
        clrscr();                                    /*it clear the screen*/
        printf("Enter 
Temperature In Centigrade");   /*prints Enter Temperature In Centigrade*/
        scanf("%f",&c);  /*It takes input from user and addresses corresponding to c*/
       f = (c * 9/5 + 32)            /*mathematical formula*/
        printf(" Its Equivalent Temperature in Fahrenheit is %f",f);  /*It prints the value after calculation*/
        getch();                                    /* return the value zero to OS*/
}


Algorithm
  1. Start
  2. Input C
  3. F = (C*9/5 + 32)
  4. Print "F"
  5. Stop
The output is:


No comments