Problem making Ascii converter loop

I made a simple Ascii converter for letters/symbols then numbers but, i want it to loop back around to the first line after. I've been searching everywhere and seeing goto and start: but i haven't gotten any to work, it doesn't take in my input for y or n at all.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
  #include <iostream>

using namespace std;

char ascii;
int numeric;
char type;

int main()
{

	label_name: cout << "Choose a letter/symbol that you \n";
	cout << "want to convert to its equivalent in the Ascii chart: ";
	cin >> ascii;
	cout << endl << endl;
	cout << "The number equivalent of the letter/symbol you \n";
	cout << "have choosen is: " << (int)ascii << endl << endl;
	cout << endl << endl;

	cout << "Choose a number that you want to \n";
	cout << "convert from the Ascii chart back to a number: ";
	cin >> numeric;
	cout << endl << endl;
	cout << "The letter equivalent of the number you \n";
	cout << "have choosen is: " << (char)numeric << endl << endl;


	
	do
	{
		cout << "Do you want to start again and \n";
		cout << "pick another letter/symbol ? [Y/N]:";
		cin >> type;
	}

	while (type == 'y' || type == 'n');
	{
		if (type == 'y')
			goto label_name;
	}
	cout << endl << endl;


	system("pause");
	return 0;
}
#include <iostream>

using namespace std;

char ascii;
int numeric;
char type;

int main()
{
do
{
cout << "Choose a letter/symbol that you \n";
cout << "want to convert to its equivalent in the Ascii chart: ";
cin >> ascii;
cout << endl << endl;
cout << "The number equivalent of the letter/symbol you \n";
cout << "have choosen is: " << (int)ascii << endl << endl;
cout << endl << endl;

cout << "Choose a number that you want to \n";
cout << "convert from the Ascii chart back to a number: ";
cin >> numeric;
cout << endl << endl;
cout << "The letter equivalent of the number you \n";
cout << "have choosen is: " << (char)numeric << endl << endl;




cout << "Do you want to start again and \n";
cout << "pick another letter/symbol ? [Y/N]:";
cin >> type;
}

while (type == 'y');
cout << endl << endl;


system("pause");
return 0;
}
Thanks man !
Topic archived. No new replies allowed.