C Programming: Temperatures of a city in Fahrenheit degree

Posted on:
tags: , , ,


Q-3: Temperatures of a city in Fahrenheit degree are input through a keyboard. Write a prgram to convert the temperature into centigrade degrees.
#include<stdio.h>
#include<conio.h>
void main()
{
                float c,f;
                clrscr();
                                printf("\n\t\tENTER THE TEMPRATURE IN FARENHEIT:");
                                scanf("%f",&f);
                                                c=5*(f-32)/9;
                                printf("\n\t\tTHE TEMPRATURE IS IN CELSIUS:%f",c);
                getch();

}

No comments:

Post a Comment

< >