slacker Posted June 30, 2011 Report Share Posted June 30, 2011 (edited) // Conversion - Program to convert temperature from Celcius Degrees into Fahrenheit:// Fahrenheit = Celcius * (212 -32)/100 + 32#include #include #include using namespace std;int main(int nNumberofArgs, char* pszArgs[]){ // enter the temperature in Celsius int celcius; cout << "Enter the Temperature in Celsius:"; cin >> celcius; //calculate conversion factor for Celsius // to fahrenheit int factor; factor = 212 - 32; // use conversion factor to convert Celcius // into fahrenheit values int fahrenheit; fahrenheit = factor * celcius/100 + 32; // output the results (followed by a Newline) cout << "Fahrenheit value is:"; cout << fahrenheit << endl; // wait untul user is ready before terminating program // to allow the user to see the program results system("PAUSE"); return 0;} Edited June 30, 2011 by slacker Quote Link to comment Share on other sites More sharing options...
cmiN Posted June 30, 2011 Report Share Posted June 30, 2011 sudo python -c "print(input('Celsius: ') * (212 - 32)/100 + 32)" Quote Link to comment Share on other sites More sharing options...