/******************************************************************* |
* C++ program to convert temperature from either Fahrenheit to * |
* Celsius or vise-versa. * |
* * |
*******************************************************************/ |
#include<iostream> |
#include<cctype> |
usingnamespacestd; |
intmain() |
{ |
int temp, tempCon; |
char unit; |
cout << 'Please enter the temperature and measurement system (c or f): '; |
cin >> temp; |
cin >> unit; |
if ( isupper(unit) ) |
{ |
unit = tolower(unit); |
} |
if (unit 'f') |
{ |
temp = (temp - 32) / 9.0 * 5.0; |
cout << temp << ' degrees Celsiusn'; |
} |
elseif (unit 'c') |
{ |
temp = 9.0 / 5.0 * temp + 32; |
cout << temp << ' degrees Fahrenheitn'; |
} |
else |
{ |
cout << 'Sorry that unit of measure isn't recognized around here.n'; |
} |
return0; |
} |
What is the line by line explanation of the above code please |
gumagana po ba nyan ? |
:( |