//
// Program to convert temperature from Celsius degree
// units into Fahrenheit degree units:
// Fahrenheit = Celsius * (212-32)/100 +32
//
#include <stdio.h>
#include <iostream.h>
int main(int nNumberofArgs, char* pszArgs[])
{
int exit;
exit = 1;
while (exit==1)
{
int split;
split = 1;
cout << "1. Convert Celsius to Fahrenheit? \n2. Convert Fahrenheit to Celsius?\n"
cin >> split;
// decide which way to convert
if (split == 1)
{
// enter the temerature in Celsius
int celsius;
cout << "Enter the Celsius temprature:\n";
cin >> celsius;
// calculate conversion factor for Celsius
// to Fahrenheit
int factor;
factor = 212 - 32;
// use conversion factor to convert Celsius
// into Fahrenheit values
int fahrenheit;
fahrenheit = factor * celsius/100 + 32;
// output the results
cout << "The Fahrenheit would be:\n";
cout << fahrenheit;
}
else
{
// enter the temerature in Fahrenheit
int fahrenheit;
cout << "Enter the Fahrenheit temprature:\n";
cin >> fahrenheit;
// calculate conversion factor for Fahrenheit
// to Celsius
int factor;
factor = 212 - 32;
// use conversion factor to convert Fahrenheit
// into Celsius values
int celsius;
celsius = factor / fahrenheit * 100 - 32;
// output the results
cout << "The Fahrenheit would be:\n";
cout << fahrenheit;
}
// quit the program or not?
cout << "\nConvert again? \n21. yes \n2. no \n";
cin >> exit;
}
return 0;
}
the compiler says...
18, parse error before `>'
i marked line 18 in bold