Hi, I am trying to create a little fun program that calculates Fahrenheit to Celcius and opposite, I've only created the Fahrenheit part for now. Thank you!
#include <iostream>
#include <string>
usingnamespace std;
int main ()
{
string a;
string f;
string c;
cout << "Hello! Would you like too calculate Fahrenheit into Celcius? Or opposite? If you want fahrenheit > celcius then press 1, if opposite press 2." << endl;
getline (cin, a);
if (a == '1') {
cout << "How many fahrenheit do you want too calculate?" << endl;
getline (cin, f);
cout << f/1,8;
} else {
{
cout << "How many celcius do you want to calculate?" << endl;
}
system("PAUSE");
return 0;
}
@Chervil
Thank you very much! I just tried it and it still doesn't work? It says at the bottom[Warning] In function 'int main()': and: parse error at end of input.
It says at the bottom[Warning] In function 'int main()': and: parse error at end of input.
The original code had mismatched opening/closing braces { }. At the end of line 17, there is an opening brace { and then at the start of line 18 there is another opening brace. One of them has to go.