Problem with loops

Hi im just learning cpp and have a problem with loops here is some example code

#include <iostream>
using namespace std;



int main()

{
int title;
loop:

cout << "Welcome to Text world" << endl;
cout << "Press 1 to start or 2 for help ";

cin >> title;

if
(title == 1)
cout << "loading..." << endl;

else if
(title == 2)
cout << "Help...." << endl;

else
cout << "Invalid selection, please try again...." << endl;
goto loop;





return 0;
}
The code works but if option 1 or 2 is chosen the program loops and thats no what I wan I just want it to loop with the eles statement not the others.
hope someone can help
Nice to meet you(r) boobs. :)

You can use curly brackets  to have more than one statement in the else part.
1
2
3
4
5
6
...
else
{
	cout << "Invalid selection, please try again...." << endl;
	goto loop;
}
Thanks peter thats a big help.....
Topic archived. No new replies allowed.