please i just started on C++ 2 weeks back and have got assignments. if i do not declare a variable and need to use cin to declare it and have used the if command to select a range of inputs, how do i get to return back to the cout if the input is not within the range needed.
for example:
#include <iostream>
using namespace std;
#include <string>
int main()
{
string d;
cout<<"what kind of game is it:\t";
cin>> d;
if
{
((d =="boom") || (d == "loom") || (d == "doom") );
}
else
{
}
return 0;
}
if the person puts in a wrong game name, how do i get the input ignored and the cout reprinted