if (yesno == "Y") {
return 0;
}
else if (yesno == "N") {
system("pause");
}
The command "return" exits from main. Therefore, if they enter "Y", main is exited. You want the program to terminate if they hit "N", otherwise ignore the input.
cout << "Try again? Y/N: ";
cin >> yesno;
if(yesno == "N") {
return 0;
}
}
}
By the way, you should probably practice proper indenting style. It makes code a lot more readable. One popular method is 4 spaces per block, keeping the open bracket on the same line as what opens the block, and the close bracket on a new line a level down (as shown in my posted code).