Check out example codes for "temperature conversion in c++". It will help you in understanding the concepts better.

Code Example 1

def main():
	units = input("Which temperature you are using? (F for Fahrenheit, C for Celsius): ")
	temp = eval(input("Please enter the temperature: "))
	if (units == 'F'):
		celcius = 5*(temp - 32)/9
		print("The temperature is", celcius, "Celcius.")
		fahrenheit = 9*temp / 5+32
		print("The temperature is", fahrenheit, "Fahrenheig")

Learn ReactJs, React Native from