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*/
#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*/
}
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
- Start
- Input C
- F = (C*9/5 + 32)
- Print "F"
- Stop
The output is:
Post a Comment