Why is state of inputs/outputs changing when these pins are not connected|

I have pins 22-37 set as outputs randomly changing state every loop, and 38-45 being read as inputs each loop, why is 38-45 changing state with nothing connected to any of them?

If you read the state of inputs which are not connected to anything at all, they are reading static electricity, which may have a component of pick-up from other pins on the chip if those are rapidly changing.

Why would you ever think that reading a pin which is not connected would not read an essentially random value?

because no output was defined in the sketch

I know its significantly reduced when i set INPUT_PULLUP