Output pins unexpectly going HIGH. HELP PLZ

I made this simple program that read four pins that I set as inputs to read certain sequences that represent 1 to 15 in binary. Then based on the certain patteren it drives 1 output pin for different relays. Right now I don't have the relays attached just LED's for debugging purposes. My setup is 10, 11, 12, 13 are input pins coresponding to 0000 in binary and 23 to 53 odd numbers only represent the 15 different patterns other than all zeros. So I connect a 3.3v supply to input 13 and pin 25 lights LED 1 but pin 27 also lights its LED even though I don't not set that pin HIGH. So my question is what am I doing wrong? Here is my code

/*  This is an implementation of 4 inputs to drive 
    15 relays connected to 15 pins */

// constants won't change. Used here to 
// set pin numbers:
const int posZero =  13;       // the pin number for position zero
const int posOne =  12;        // the pin number for position one
const int posTwo =  11;        // the pin number for position two
const int posThree =  10;      // the pin number for position three
const int relayLow = LOW;      // relayLow used to set the relay to low
const int relayHigh = HIGH ;
// Variables will change:
  int zero = 0;
  int one = 0;
  int two = 0;
  int three = 0;
//  int oldState = 0;
  int newState = 0;
  int curPin = 0;
//  int prevPin = 0;
 // int count = 23;
  boolean state1 = false;
  boolean state2 = false;
  boolean state3 = false;
  boolean state4 = false;
  boolean state5 = false;
  boolean state6 = false;
  boolean state7 = false;
  boolean state8 = false;
  boolean state9 = false;
  boolean state10 = false;
  boolean state11 = false;
  boolean state12 = false;
  boolean state13 = false;
  boolean state14 = false;
  boolean state15 = false;

  
void setup() {
  // set the digital pin as input:
  pinMode(posZero, INPUT);  
  pinMode(posOne, INPUT);      
  pinMode(posTwo, INPUT);      
  pinMode(posThree, INPUT);

  // set the digital pin as output:
//  pinMode(23, OUTPUT);      
  pinMode(25, OUTPUT);      
  pinMode(26, OUTPUT);      
  pinMode(28, OUTPUT);      
  pinMode(31, OUTPUT);      
  pinMode(33, OUTPUT);      
  pinMode(35, OUTPUT);      
  pinMode(37, OUTPUT);      
  pinMode(39, OUTPUT);      
  pinMode(41, OUTPUT);      
  pinMode(43, OUTPUT);      
  pinMode(45, OUTPUT);      
  pinMode(47, OUTPUT);      
  pinMode(49, OUTPUT);      
  pinMode(51, OUTPUT);      
  pinMode(53, OUTPUT);       
}

void loop()
{
  // here is where you'd put code that needs to be running all the time.

  // check to see if it's time to blink the LED; that is, if the 
  // difference between the current time and last time you blinked 
  // the LED is bigger than the interval at which you want to 
  // blink the LED.



    zero = digitalRead(posZero);
    one = digitalRead(posOne);
    two = digitalRead(posTwo);
    three = digitalRead(posThree);
    
  newState = (((2*2*2)* three) + ((2*2)* two) + (2 * one) + (1 * zero));
      
        switch(newState) {
            case 0:

                //digitalWrite(curPin, LOW);
                 // pinMode(curPin, INPUT);
               
               curPin = 0;
               
                if(state2 == true){
                  state2 = false;
                digitalWrite(25 , LOW );
                delay(1);
                }
               if(state1 == true){
                  state1 = false;
                digitalWrite(27 , LOW );
                delay(1);
                }
                if(state3 == true){
                  state3 = false;
                digitalWrite(29 , LOW );
                delay(1);
                }
                if(state4 == true){
                  state4 = false;
                digitalWrite(31 , LOW );
               delay(1);
                }
                break;
                
            case 1:
                
                curPin = 25;
                state1 = true;
              break;  
            
            case 2:
                state2 = true;
                curPin = 26;
              break;  
              
            case 3:
                state3 = true;
                curPin = 28;
              break; 
              
            case 4:
                state4 = true;
                curPin = 31;
              break; 

        }
        if(curPin != 0){
          //pinMode(curPin, OUTPUT);
        digitalWrite(curPin, relayHigh);
        delay(1);}
      
}

My first suggestion would be that you need to look at using arrays - an array of input pins, an array of output pins, and an array of states.

My second suggestion is that you try to understand what ODD numbers are.

My setup is 10, 11, 12, 13 are input pins coresponding to 0000 in binary and 23 to 53 odd numbers only

//  pinMode(23, OUTPUT);      
  pinMode(25, OUTPUT);      
  pinMode([glow]26[/glow], OUTPUT);      
  pinMode([glow]28[/glow], OUTPUT);      
  pinMode(31, OUTPUT);      
  pinMode(33, OUTPUT);
                digitalWrite([glow]27[/glow] , LOW );
                delay(1);
                }
                if(state3 == true){
                  state3 = false;
                digitalWrite([glow]29[/glow] , LOW );

My first suggestion would be that you need to look at using arrays - an array of input pins, an array of output pins, and an array of states.

My second suggestion is that you try to understand what ODD numbers are.

Sorry I posted the code I changed because I thought something was wrong with pin 27 and 29 but I changed it back and that did not help. Now for your first suggestion, how do I go about doing that, arrary of output pins and input pins and states.

Now for your first suggestion, how do I go about doing that, arrary of output pins and input pins and states.

int posPins[] = {13, 12, 11, 10};
boolean states[15];
int outPins[] = {23, 25, 27, 29, 31, 33, 35, 37, 39, 41, 43, 45, 47, 49, 51, 53};

void setup()
{
   for(int i=0; i<sizeof(posPins)/sizeof(posPins[0]); i++)
   {
      pinMode(posPins[i], INPUT);
   }
   for(int i=0; i<sizeof(outPins)/sizeof(outPins[0]); i++)
   {
      pinMode(outPins[i], OUTPUT);
   }
   for(int i=0; i<sizeof(states)/sizeof(state[0]); i++)
   {
      states[i] = false;
   }
}

Relevant changes will need to be made in loop, too.

So I connect a 3.3v supply to input 13 and pin 25 lights LED 1 but pin 27 also lights its LED even though I don’t not set that pin HIGH. So my question is what am I doing wrong?

What is connected to pins 12, 11, and 10 while you are doing this? If nothing, then you have a floating pin condition. You should not be reading the state of an input pin with nothing connected to it, and expecting reasonable values.

What is connected to pins 12, 11, and 10 while you are doing this? If nothing, then you have a floating pin condition. You should not be reading the state of an input pin with nothing connected to it, and expecting reasonable values.

Thank you that was my problem now everything works fine