From c09b10e4c2312c2583e4ecdca6673e80e4256afe Mon Sep 17 00:00:00 2001 From: royo Date: Wed, 10 Sep 2025 20:42:37 +0000 Subject: [PATCH] Upload files to "/" --- tempconv.cpp | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 tempconv.cpp diff --git a/tempconv.cpp b/tempconv.cpp new file mode 100644 index 0000000..465ed45 --- /dev/null +++ b/tempconv.cpp @@ -0,0 +1,38 @@ +// +// Conversion - convert temperature from Celsius +// degree units into Fahrenheit degree +// units: +// Fahrenheit = Celsius * (212 - 32)/100 + 32 +// +#include +#include +#include +using namespace std; + +int main(int nNumberofArgs, char* pszArgs[]) +{ + // enter the temperature in Celsius + int nCelsius; + cout << "Enter the temperature in Celsius:"; + cin >> nCelsius; + + // calculate conversion factor for Celsius + // to Fahrenheit + int nFactor; + nFactor = 212 - 32; + + // use conversion factor to convert Celsius + // into Fahrenheit values + int nFahrenheit; + nFahrenheit = nFactor * nCelsius/100 + 32; + + // output the results + cout << "Fahrenheit value is:"; + cout << nFahrenheit; + cout << endl; + + // wait until user is ready before terminating program + // system("PAUSE"); + return 0; +} +