The if/else if/else
conditions are used in the following way:
Single condition
if (condition)
{
// code to execute
}
Double condition
if (condition)
{
// code to execute
}
else
{
// code to execute
}
Multiple condition
if (condition)
{
// code to execute
}
else if (condition2)
{
// code to execute
}
else if (condition3)
{
// code to execute
}
...
else
{
// code to execute
}
You have a condition after your else
and that's why you get the compilation error.
If this answers your question please accept it by clicking the gray check-mark to the left, so that it becomes green. You can also vote it up by pressing the up arrow above the check-mark. And don't forget to keep coding!