Run ❯
Get your
own
website
❯
Run Code
Ctrl+Alt+R
Change Orientation
Ctrl+Alt+O
Change Theme
Ctrl+Alt+D
Change Language
Go to Spaces
Ctrl+Alt+P
#include
#include
using namespace std; void convert(int celsius) { double fahrenheit = celsius * 9.0 / 5 + 32; cout << celsius << " Celsius = " << fahrenheit << " Fahrenheit\n"; } int main() { cout << fixed << setprecision(1); convert(25); convert(0); convert(100); convert(-40); convert(37); return 0; }
25 Celsius = 77.0 Fahrenheit
0 Celsius = 32.0 Fahrenheit
100 Celsius = 212.0 Fahrenheit
-40 Celsius = -40.0 Fahrenheit
37 Celsius = 98.6 Fahrenheit