this for statement is supposed to return a number other than one, but will always return one, showing that it is not getting past the first try i believe. I changed this statement multiple times to about five lines of logic statements, this is its simplest form.
Code:
for(mchoice = 1; mchoice != choice && mchoice != car; mchoice++);
the rest of the code is as follows:
Code:
#include<stdio.h>
#include<stdlib.h>
int main(void){
int car, choice, mchoice;
car = rand() % 3 + 1;
printf("Which door would you like to pick? (1-3) ");
scanf("%i", &choice);
for(mchoice = 1; mchoice != choice && mchoice != car; mchoice++);
printf("Monty shows you a goat behind door number %i\n", mchoice);
return 0;
}