Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

C++ Fahrenheit to Celsius

    float far, cel;
    
    cout << "Enter the temperature in Fahrenheit: ";
    cin >> far;

    cel = (far - 32) / 1.8;      //(°F - 32) / 1.8 = °C

    cout << "The temperature of " << far << " in Celsius is: " << cel;
 
PREVIOUS NEXT
Tagged: #Fahrenheit #Celsius
ADD COMMENT
Topic
Name
8+2 =