Temperature (F° to C°)

Hello, this is my #WSQ02 program for week 3, this task consisted in creating a program that coverted a temperature typed by the user in Fahrenheit and change it to degrees and tell the user if the temperature can boil water or not. This program was still easy for me and I needed no help from friends or research on internet.

Here´s the program and its result:

#include <iostream>

using namespace std;

double c,f;

int main(){

cout << “Type a temperature in Fahrenheit: “;
cin >> f;

c=5*(f-32)/9;
cout << “The temperature in celsius is: ” <<c<<endl;
if (c>=100){
cout << “Water does boil in this temperature (under typical conditions): ” << endl;
}
else{
cout << “Water does not boil in this temperature (under typical conditions)”<<endl;
}

return 0;
}

temperature.jpg

Leave a comment