C++ Program:
Prompt the user to enter a Fahrenheit degree then using the following formula to convert it to Celsius degree. Don't accept any value less than -60 and more than 200.
C = (5/9)*(F – 32)
#include <iostream> using namespace std; int main() { double f = -100, c; while (f < -60 || f > 200) { cout << "Enter temperature in fahrenheit(-60 to 200): "; cin >> f; } c = (f - 32) / 1.8; cout << f << " degrees fahrenheit is " << c << " degrees celsius" << endl; return 0; }
Get Answers For Free
Most questions answered within 1 hours.