Created
February 17, 2015 20:59
-
-
Save samir96/fd45b7e7822b2c486da0 to your computer and use it in GitHub Desktop.
IF
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
int main(){//Jorge Samir Godinez Lara | |
int F,C; | |
cout <<"\nGive me the actual temperature in Farenheit and I'll convert to Celsius: "; //This is an output line, where I ask the user for Temperature | |
cin >>F; //This is the variable that I use to save Farenheit Temperature | |
C=5*(F - 32)/9; //This is the formula to convert Farenheit degrees to Celsius. | |
if (C >= 100){ //Here I establish conditional, for do something in case the Celsius temperature is over and/or equal 100 degrees. | |
cout<<"\nA temperature of: " <<F<< " degrees Farenheit is: " <<C<< " degrees Celsius "<<endl; // This is the output I gave to the user. | |
cout<<"\nWater boil at this temperature"<<endl; //The output where I said the water boil at this temperature. | |
} | |
8 else{ | |
cout<<"\nA temperature of: " <<F<< " degrees Farenheit is: " <<C<< " degrees Celsius "<<endl; // This is the output I gave to the user. | |
cout<<"\nWater does not boil at this temperature"<<endl;//The output where I said the water does not boil at this temperature. | |
} | |
return 0; | |
} | |
6 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment