Need Help

If I have a (Y/N) statement where I have both "y" and "n" as answers, but to be correct, you can't have a wrong answer, how can I have it to where if it sees an "n" answer (all of the correct answers are y), that it goes to Not_Correct()?


This is what I have so far, but if I answer all questions with "y" (the correct answers), it takes me to Not_Correct().

I'm very new to this, so any help is appreciated.
1
2
3
4
5
6
7
8
9
10
11
12
	if (correct = 0 || 1) {
		Not_Correct();
	return(0);
	}
	else
	if (correct = 0) {
		Not_Correct();
	}
	else
	if (correct = 1) {
		Correct();
	}
The equality operator is == and the assignment operator is =

If I declare a variable:

 
int number;


I can assign a value to it:

 
number = 10;


The 'number' variable now holds the value 10. I can check that this is correct with use of the equality operator:

1
2
3
4
if (number == 10)
   Correct();
else
   Not_Correct();


Does that help?
Still not working :\.
Please show more of your code where does the 'correct' variable get it's value and what is the value in your test scenario?
also note that if you want to do an OR, that this is wrong:
1
2
if (correct = 0 || 1)
...


You would need to do something like this:

1
2
if (correct == 0 || correct == 1)
...


Never mind, that fixed it, I just didn't understand at first, sorry.

Thank you for the help.
Topic archived. No new replies allowed.