My program give me errors What is w

int main()
{
int fahrenheit; celsius;

cout << "Please enter a temperature in Fahrenheit: ";
cin >> fahrenheit;
cout << fixed;
cout << setprecision(0);
float celsius = 5.0 / 9.0 * ((float) fahrenheit - 32);
cout << "Celsius: "
<< celsius
<< endl;
return 0;
}
1
2
3
4
5
6
7
8
9
10
11
12
13
#include <iostream>
#include <iomanip>

int main()
{
    double fahrenheit ;
    std::cout << "Please enter a temperature in Fahrenheit: " ;
    std::cin >> fahrenheit ;

    const double celsius = 5.0 / 9.0 * (fahrenheit-32) ;

    std::cout << "Celsius: " << std::fixed << std::setprecision(2) << celsius << '\n' ;
}
Topic archived. No new replies allowed.