#include <iostream>
#include <cstdlib> // <-- you need this to use system();
usingnamespace std; // <-- you are missing this before
int main() // <-- you have an extra semicolon before
{
double f_temp, k_temp, c_temp, temp;
char ch, quit;
cout<< " *********** Temprature Conversion Calculator **************";
cout<< "\n\n Please enter the temprature unit for which you want the coverison ";
cout<< "\n 1. F for Fahrenheit to Celcius and Kalvin";
cout<< "\n 2. C for Celsius to Fahrenheit and Kalvin";
cout<< "\n 3. K for Kalvin to Fahrenheit and Celcius";
startagain:
cout<< "\n\n Please enter you choice: ";
cin >> ch;
switch(ch)
{
case'f':
case'F':
cout<< " Please enter temprature in Farhenheit: ";
cin >> f_temp;
c_temp = (f_temp - 32) * 5/9;
k_temp = (f_temp + 459.67) * 5/9;
cout<< " Celcius =" << c_temp; // <--- you're missing << here
cout<< "\n Kelvin =" << k_temp; // <-- you're missing << here
cout<< "\n Do you want to calculate another value (y/n): ";
cin >> quit;
if (quit == 'y' || quit == 'Y')
goto startagain;
break;
case'c':
case'C':
cout<< " Please enter temprature in Celcius: ";
cin >> c_temp;
k_temp = c_temp + 273.15 ;
f_temp = c_temp * 9/5 + 32;
cout<< " Kelvin =" << k_temp; // <-- missing << here
cout<< "\n Farhenheit =" << f_temp; // <-- missing << here
cout<< "\n Do you want to calculate another value (y/n): ";
cin >> quit;
if (quit == 'y' || quit == 'Y')
goto startagain;
break;
case'k':
case'K':
cout<< " Please enter temprature in Kelvin: ";
cin >> k_temp;
c_temp = k_temp - 273.15 ;
f_temp = (k_temp - 273.14) * 9/5 + 32;
cout<< " Celcius =" << c_temp; // <-- here also
cout<< "\n Farhenheit =" << f_temp; // <-- here also
cout<< "\n Do you want to calcute another value (y/n): ";
cin >> quit;
if (quit == 'y' || quit == 'Y')
goto startagain;
break;
default:
cout<< "\n Invalid Choice";
}
cout<< endl; // <-- in you previous code it's endlendl
system("pause");
}