Hello!
I'm trying to make a command line program that converts Celsius to Fahrenheit, and then asks if you would like to convert another number. This is the code I have (below) however when it gets to the point of asking if you would like to convert another number, no matter the input it always exits! Please advise!
#include <stdio.h>
#include <iostream>
using namespace std;
int main(int nNumberofArgs, char * pszArgs[])
{
for(;;)
{
// enter the temperature in celsius
int nCelsius;
cout << "Enter the temperature in Celsius:";
cin >> nCelsius;
//Conversion factor for celsius to fahrenheit
int nFactor;
nFactor = 212 - 32;
int nFahrenheit;
nFahrenheit = nFactor * nCelsius/100 + 32;
//output the results
cout << "Fahrenheit value is:";
cout << nFahrenheit;
//loop?
cout << "Would you like to preform another conversion? Enter Y for yes or N for no";
char cDoContinue;
cin >> cDoContinue;
if(cDoContinue = 'n'){
break;
}
system("PAUSE");
}
return 0;
}
PS. If you can also find a way to format the text so there are breaks between each "cout" that would be great!
Thanks!