Best Code Practice Validation - C
Have some variables that I need to perform validation on. Pseudocode is as follows but I feel there must be a more elegant soloution.

 

      If ( var != A || var != B || var != C || var != D )
        	{
        	reject
        	}
        else if ( var = A || var = B)
        	{
        	do validation applicable to A or B
        	}
        else if ( var = A || var = B || var = C || var = D )  
        	{
        	do validation applicable to all valid vars
        	}
Best Code Practice Validation - C
===

Have some variables that I need to perform validation on. Pseudocode is as follows but I feel there must be a more elegant soloution.

 

      If ( var != A || var != B || var != C || var != D )
        	{
        	reject
        	}
        else if ( var = A || var = B)
        	{
        	do validation applicable to A or B
        	}
        else if ( var = A || var = B || var = C || var = D )  
        	{
        	do validation applicable to all valid vars
        	}