viewing paste fahrenheitToCelsius | C++

Posted on the
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
#include <iostream>
 
double fahrenToCelsius(double temp){
        return (temp - 32)*5/9;
}
 
int main () {
       
        double fah = 0;
       
        std::cin >> fah;
       
        std::cout << "Is: " << fahrenToCelsius(fah) << " Celsius";
       
        return 0;
}
Viewed 589 times, submitted by Streusel.