Q: Temperature of a City in Fahrenheit degree is input through the keyboard. Write a program to convert this temperature into centigrade degree.

#include<stdio.h>
int main()

{
    float farn, centi;  /*farn=temp in farenheit & centi=temp in centigrade*/

    printf("Enter Temperature of city in Fahrenheit: ");
    scanf("%f",&farn);

    centi = (farn-32)*5/9;

    printf("\n\nTemperature of city in Centigrade Degree: %f",centi);
    
    return 0;
}

-----------------------------------------
output:

Enter Temperature of city in Fahrenheit: 67


Temperature of city in Centigrade Degree: 19.444445

Comments

Popular posts from this blog

Q: Two number are input through the keyboard into two two locations C and D. write a program to interchange the contents of C and D.

Q: Consider a currency system in which there are note of seven denominations, namely, Rs. 1, Rs. 2, Rs. 5, Rs. 10, Rs. 50, Rs. 100. if a sum of Rs. N is entered through the keyboard, write a program to compute the smallest number of notes that will combine to give Rs N.