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: The length & breadth of a rectangle and radius of a circle are input through the keyboard. Write a program to calculate area & perimeter of the rectangle and area & circumference of the circle.

Q: If a five-digit number is input through the keyboard, write a program to calculate the sum of its digits. (Hint: Use the modulus operator ‘%’)