My output for the variable celsius is 0 everytime. I can't figure it out =(. Can anyone spot what is wrong?
Code:#include <iostream> using namespace std; double get_celsius(double); int main() { double fahrenheit, celsius; cout << "This progam converts fahrenheit to celsius.\nPlease input a fahrenheit temperature...\n"; cin >> fahrenheit; celsius = get_celsius(fahrenheit); cout << fahrenheit << " fahrenheit is " << celsius << " celsius.\n"; return 0; } double get_celsius(double fahrenheit) { return (5/9)*(fahrenheit-32); }



LinkBack URL
About LinkBacks


