I am trying to ask the user if he wants to go again on my c++ program
#include <iostream> #include <cmath> using namespace std; void selection() { cout << "Press 1 to find the area of a Triangle" << endl; cout << "Press 2 to find the area of a Square" << endl; cout << "Press 3 to find the area of a Rectangle" << endl; cout << "Press 4 to find the area of a Circle" << endl; } int main() { selection(); int select; const double pi = 3.14159265359; double base; double height; double side; double radius; double length; double width; double answer; char a; cout << endl; cin >> select; if (select == 1) { cout << endl; cout << "Enter the base" << endl; cin >> base; cout << endl; cout << "Enter the height" << endl; cin >> height; cout << endl; answer = base * height / 2; cout << "The area of the triangle is " << answer << endl; } else if (select == 2) { cout << endl; cout << "Enter the side length" << endl; cin >> side; cout << endl; answer = pow(side , 2); cout << "The area of the square is " << answer << endl; } else if (select == 3) { cout << endl; cout << "Enter the length" << endl; cin >> length; cout << endl; cout << "Enter the width" << endl; cin >> width; cout << endl; answer = length * width; cout << "The area of the rectangle is " << answer << endl; } else if (select == 4) { cout << endl; cout << "Enter the radius" << endl; cin >> radius; cout << endl; answer = pi * pow(radius , 2); cout << "The area of the circle is " << answer << endl; } while (a == 'y'||'Y') { cout << "Do you want to try again? [y/n] " << endl; cin >> a; selection(); } cout << "The End" << endl; return 0; } I tried to use a while loop to ask if the user wanted to play again but when the user enters in 'n