Your bracing is wrong, at least for the for loops. Any block like that that is more then 1 statement long must be enclose by braces so it should look something like this:
#include <iostream>
usingnamespace std;
class temperature
{
public:
void choice()
{
cout << "Please enter 1 or 2"<<endl;
cin >> y;
if ( y == 1)
{
for (c = 0; c <= 100;c++)
{
f = (c * (9/5) + 32);
cout << f;
}
}
elseif (y == 2)
{
for (f = 32; c <= 212; f++)
{
c = ((f - 32)*(5/9));
cout << c;
}
}
}
private:
int c;
int f;
int y;
};
Also, you have an extra and unnecessary set of braces around the whole if/else block.
And finally, may I ask why you are using for loops in the first place? Temperature conversion is generally a one time thing, but it looks like you are simply printing out a series of temperatures. Is that what you intended?