I am trying to write a simple code with if condition.
If(x==1||x==2||x==3)
{
found true;
}
else
{
cout<<"Please provide the correct input";
cin<<input;
}
Based on this i need to have another condition:
if(found)
{
cout<<"Enter number";
cin>>no;
}
The problem with the code is when i am entering invalid x value it is coming to else loop and again i am assigning the correct value.But when it so coming to the second condition it is not waiting for the user input.It is immediately terminating from the program.Let me know where i am doing wrong.