Redirection

hi i was wondering if there was a way to redirect someone back to the original if statement because as soon as they type in anything but the actual answer it will force them to quit i was wondering if there was a way to loop them back to the question. I am using visual basics and here is the code pleas help!


#include <iostream>

using namespace std;

int main() {
	int Choice;
	cout << "Hello, welcome to shaun's elimination Jap quiz on masu and mashou." << endl;
	cout << "You will be confronted with a series of questions answer right and you may" << endl;
	cout << "continue, wrong then you will be sent out of the quiz." << endl;
	cout << "Section 1 verb endings" << endl;
	cout << "Question 1." << endl;
	cout << "What is the verb ending for eat?" << endl;
	cout << "press 1 to select tabemasu or select 2 to answer yomimasu." << endl;
	scanf( "%d", &Choice );

	if( Choice == 1 )
	{
		cout << "Correct!" << endl;
		system("pause");
	}
	else if(Choice == 2 )
	{
		cout << "INCORRECT!" << endl;
		system("pause");
		return(0);
	}
	else
	{
		cout << "Type in one of the numbers next time." << endl;
		system("pause");
		return(0);
	}
	cout << "Question 2." << endl;
	cout << "What does shimas mean?" << endl;
	cout << "press 1 for lets do, press 2 for read, press 3 for do." << endl;
	scanf( "%d", &Choice );

	if( Choice == 1 )
	{
		cout << "INCORECT!" << endl;
		system("pause");
		return(0);
	}
	else if(Choice == 2 )
	{
		cout << "INCORRECT!" << endl;
		system("pause");
		return(0);
	}
	else if(Choice == 3 )
	{
		cout << "Correct!" << endl;
		system("pause");
	}
	else
	{
		cout << "Type in one of the numbers next time." << endl;
		system("pause");
		return(0);
	}
	cout << "Question 3." << endl;
	cout << "What does this sentance mean, tenisu o shimashou?" << endl;
	cout << "press 1 for lets watch TV, press 2 for lets play tennis, press 3 for" << endl;
	cout << "lets watch tennis?" << endl;
	scanf( "%d", &Choice );

	if( Choice == 1 )
	{
		cout << "INCORRECT!" << endl;
		system("pause");
		return(0);
	}
	else if( Choice == 2 )
	{
		cout << "Correct!" << endl;
		system("pause");
	}
	else if( Choice == 3 )
	{
		cout << "INCORRECT!" << endl;
		system("pause");
		return(0);
	}
	else
	{
		cout << "Type in one of the numbers next time." << endl;
		system("pause");
		return(0);
	}
	cout << "Good job you have hit three in a row!" << endl;
	cout << "Question 4." << endl;
	cout << "How do i say i will drink water tommorow?" << endl;
	scanf( "%d", &Choice );

	if( Choice == 1 )
	{
	}
	else if( Choice == 2 )
	{
	}
	else if( Choice == 3 )
	{
	}
	else if( Choice == 4 )
	{
	}
	else
	{
		cout << "Type in one of the numbers next time." << endl;
		system pause 
	}
	system("pause");
}
What you're looking for is called a loop.
yes how would i insert one of those here
Topic archived. No new replies allowed.