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.
#include <iostream>
usingnamespace 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;
}
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;
}