c++
I want my code to end if it detects an “x”, however, it keepsgoing even if it finds an ”x”.
string comp;
bool end;
cout << “Enter company (x to stop): “;
cin >> comp;
if (comp.find(‘x’) != string::npos)
end = true;
else
end = false;
while (end == false)
{
…………………//should continue into loop IF NO x isdetected
}
Expert Answer
An answer will be send to you shortly. . . . .