Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- float a;
- float c;
- int d = 32;
- int result;
- float e = (9/5);
- float f = (5/9);
- cout << "What are you trying to convert?\n 1.Fahrenheit\n 2.Celsius\n";
- cin >> a;
- cout << "What is the value?\n";
- if (a == 1)
- {
- cin >> c;
- result = (c - 32) * 5 / 9;
- cout << result;
- }
- else if (a == 2)
- {
- cin >> c;
- result = c * 9 / 5 + 32;
- cout << result;
- }
- else
- {
- cout << "Please enter a valid choice";
- }
- return 0;
- }
Add Comment
Please, Sign In to add comment