should be really easy to compare two numbers
if( input == passcode ) {
} else {
}
You may also look for a do while loop like
do {
input = getPasscode();
} while( input != passcode )
but here is the correct passcode the exit condition for the loop ;-)