hey guys, Im new to C++. I've tried to solve the problem but no luck. My code will be shown below. Please advice me where I went wrong. Thanks
Write a program that reads a Celsius degree in double, converts it to Farenheit, and displays the result. The formula for conversion is: farenheit = (9/5) * Celsius + 32;
(Note: 9/5 is 1 in C++, so you need to use 9.0/5)
#include <iostream>
using namespace std;
int main()
{
double C, F;
cout << "Welcome";
cout << "Enter the temperature in Celsius to convert it to Fahrenheit";
cin >> C
F = (9.0/5)*(C + 32);
system("pause");
return 0;
For future reference, it always help when your provide a description of your problem.
In your case, the program will not compile because you are missing a ";"
cout << "Welcome \n";
cout << "Enter the temperature in Celsius to convert it to Fahrenheit";
cin >> C;
F = (9.0 / 5)*(C + 32);
cout << F;
system("pause");
return 0;
}