Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- // Convert Fahrenheit to Celsius.
- int main()
- {
- double F = 0; // temperature in Fahrenheit.
- double C = 0; // temperature in Celsius.
- cout << "Enter degrees Fahrenheit:\n";
- cin >> F; // Get the degrees Fahrenheit.
- C = (5.0 / 9.0) * (F - 32); // Convert.
- // Display the result
- cout << F << " degrees Fahrenheit is "
- << C << " degrees Celsius.\n";
- // End the program.
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement