else if (digitalRead (pin1) == LOW and //Code to display 4
digitalRead (pin2) == LOW and
digitalRead (pin3) == HIGH and
digitalRead (pin4) == LOW)
...
It is a bad practice to use single capital letters as identifiers.
const int F = 6;