Hello
I've been messing around with this for a bit but I can't seem to find a solution to this problem.
When I run my code and I try to make it run the elseif statement it runs the if statement instead. I hope some of you can help me with this little problem.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
<iostream>
usingnamespace std;
int statement1=1,statement2=1;
main()
{
if((statement1==1)||statement2==1)&&(statement1==2)||(statement 2==2))
{
Do something //Runs this
}
elseif((statement1==1)&&(statement2==1))
{
Do something else
}
return 0
}
Yeah I think so. What I'm trying to do is make a menu where I can choose two options including the same option twice. I would imagine that's the way of doing it. Am I wrong?