pincode

Hello, I am working on a school project at the moment and found a problem that I can't solve easily. The problem is I want to make a pincode and when the answer is correct then it does somethig but when the answer is wrong it also does something but I can't find a way to make the combinations when it is wrong because I don't want it to always say "that is wrong" only when the combination has been made that it displays something to indicate that it is wrong and then reset the pincode to try again. This is what i have at the moment but it isn't what I want so pls can someone help me.

void kc(){ //when the code is correct or wrong
kleurb();
if ((c1 == 3) && (c2 == 4) && (c3 == 2) && (c4 == 3) && (c5 == 4)){
eindej();

digitalWrite(LG , 1);
delay(50);

Stuur();
}
else if (((c1 == 3) && (c2 == 4) && (c3 == 2) && (c4 == 3) && (c5 == 4)) == false){
eindef();
digitalWrite(LR , 1);
delay(50);

}
}

This is what i have at the moment but it isn't what I want so pls can someone help me.

What is that supposed to mean?

Please remember to use code tags when posting all your code

You can replace

else if (((c1 == 3) && (c2 == 4) && (c3 == 2) && (c4 == 3) && (c5 == 4)) == false){

with

else{

Try this

void loop()
{
 if (c1==3 && c2==4 && c3==2 && c4==3 && c5==4)
 {
  Do something
  }
 else if (c1!=3 && c2!=4 && c3!=2 && c4!=3 && c5!=4)
 {
  Do something
  }
 else
 {
 Do something when above conditions are not met
 }
}

Like the others have said if the wrong combination entered just use an else statement

In the else statement you can cycle through an array to change what happens when

the incorrect combination is entered. I used different print statements but you can use an array of integers
and based on the integer do something else.

Here is an example:

char const *errmsg[]={"You pushed the wrong keys","You pushed the wrong keys again","Your all thumbs" };
int index=0;


void kc(){ //when the code is correct or wrong
kleurb(); 
if ((c1 == 3) && (c2 == 4) && (c3 == 2) && (c4 == 3) && (c5 == 4)){
   eindej();

   digitalWrite(LG , 1);
   delay(50);
   
   Stuur();
  }
else {
    Serial.println(errmsg[index]);
        
         if(index < 3 ) {
            index=index + 1;
         }
         else {
            index=0;
         } 
  
  eindef();
  digitalWrite(LR , 1);
  delay(50);
 
 }
}