Several things:
1) switch does not take conditionals. The case value IS the conditional. E.g., the following control structures are equivalent:
1 2 3 4 5 6 7
|
switch(number) {
case 5: ... // Code
}
if(number == 5) {
... // Code
}
|
In your case, that means the switches are working on an uninitialized variable. If it would run (I doubt it does), it would go directly to "default", because uninitialized numbers generally (in my compiler anyway) have a very large negative value.
2) "getch()==answer1;" doesn't make sense. Firstly, the variable being assigned a value is ALWAYS on the left. Secondly, "==" is the comparator, not the assignment operator. Thirdly, getch() doesn't work that way. Fourthly, getch() is depracated. Use std::cin instead (<iostream>).
3) Don't use system("pause"). It kills unborn babies. Or is unsafe or something, who knows. Anyway, don't use it. I think you meant to use "break" (which is used to "stop" a switch case. Without break, case 1 will continue until the end, executing EACH case below it).
4) Don't put }'s on the same line. It's difficult to read (and count)!
5) Your main must return a value. Add "return 0" at the end.