Physics, asked by chaturvedivirat123, 1 year ago

temperature of a city in fahrenheit degrees is input through the keyboard. write a program to convert this temperature into centigrade degrees.

Answers

Answered by 0Panda0
18

#include<stdio.h>

#include<conio.h>

void main(void)

{

float fahr, centi;

printf("Please enter temperature in Fahrenheit : ");

scanf("%f", &fahr);

centi=5.0*(fahr-32.0)/9.0;

printf("The temperature in Centigrade would be %f", centi);

getch();

}


Answered by GulabLachman
0

Python program to convert this temperature into centigrade degrees.

The conversion of Farenheit to Celcius is done as the formula:

C = (F-32) × 1.8

where C is the temperature in Celcius and F is the temperature in Farenheit.

print("Enter '1' for exit.");

F = input("Enter temperature in Fahrenheit: ");

if F == '1':

   exit();

else:

   fahrenheit = float(F);

   celsius = (fahrenheit-32)/1.8;

   print("Temperature in Celsius is =",celsius);

Similar questions