I swear this is my last one for the night. This while loop should be presenting the menu until a valid option is selected. Right now it just repeats the menu even after a valid option is selected. I'm guessing my logic is messed up in my evaluation statement.


Code:
int displayMenu (){


	int x=0;


		do{
			printf("\n1.\tThis is option 1");
			printf("\n2.\tThis is option 2");
			printf("\n3.\tThis is option 3");
			printf("\n4.\tThis is option 4");
			printf("\n5.\tThis is option 5");
			printf("\n9.\tThis is option 9");
			
			printf("\n\n\nPlease enter a menu option:");
			scanf("%d",&x);
			
	
			
			if (x!=1 && x!=2 && x!=3 && x!=4 && x!=5 && x!=9)
				printf("\a\a\a\n\n\n\n\n\nI'm sorry please pick a valid menu option!!!\n\n\n");
		}while(x<1 || x >5 && x<9 || x>9);
		
		
return x;
}