How to press a button to add a number to a variable

Im new to this so please ignore my stupidity ,this may seem really stupid. heres my code

const int TOP = 8;
const int TL = 9;
const int TR = 12;
const int MIDDLE = 5;
const int BL = 1; 
const int BR = 4;
const int BOTTOM = 2;
const int DOT = 3;

const int BUTTON = 13;
int buttonState = 0;
int A =0;
const int FIRST = 7;
const int SECOND = 10;
const int THIRD= 11;
const int FOURTH = 6;

void setup() {
pinMode(TOP, OUTPUT);
pinMode(TL, OUTPUT);
pinMode(TR, OUTPUT);
pinMode(MIDDLE, OUTPUT);
pinMode(BR, OUTPUT);
pinMode(BL, OUTPUT);
pinMode(BOTTOM, OUTPUT);
pinMode(DOT, OUTPUT);

pinMode(BUTTON, INPUT);

pinMode(FIRST, OUTPUT);
pinMode(SECOND, OUTPUT);
pinMode(THIRD, OUTPUT);
pinMode(FOURTH, OUTPUT);

}

void loop() {
 buttonState = digitalRead(BUTTON);
 if (buttonState == HIGH) {
  A=A+1;
 } 
  if (A == 0) {
digitalWrite(BL, HIGH); //1
digitalWrite(BOTTOM, HIGH); //2
digitalWrite(DOT, HIGH); //dot
digitalWrite(BR, HIGH); //4
digitalWrite(MIDDLE, HIGH); //5

digitalWrite(FOURTH, HIGH); //4th
digitalWrite(FIRST, LOW); //1st

digitalWrite(TOP, HIGH); //8
digitalWrite(TL, HIGH); //9

digitalWrite(SECOND, HIGH);  //2st
digitalWrite(THIRD, HIGH); //3rd

digitalWrite(TR, HIGH); //12
      }
  else if (A==3) {
   digitalWrite(BL, HIGH); //1
digitalWrite(BOTTOM, HIGH); //2
digitalWrite(DOT, HIGH); //dot
digitalWrite(BR, HIGH); //4
digitalWrite(MIDDLE, HIGH); //5

digitalWrite(FOURTH, HIGH); //4th
digitalWrite(FIRST, HIGH); //1st

digitalWrite(TOP, HIGH); //8
digitalWrite(TL, HIGH); //9

digitalWrite(SECOND, LOW);  //2st
digitalWrite(THIRD, HIGH); //3rd

digitalWrite(TR, HIGH); //12
  }
}

What i want to do :when i press a button ,i want to change some things in my 7 segment display, I tried doing that by recording the button's state using A=A+1 I would then make a ton of else ifs with A== . My problem that its not working, i think by setting it in the loop A will keep adding up in one click.

What i see when i click the button: the other light keeps flickering like it was enabled and disabled quickly Thanks yall

Your variable will increment hundreds or thousands of times a second. Try incrementing it when the switch becomes pressed, instead of while it is pressed. Have a look at the state change example in the IDE

Thank you so much! sorry for posting such a stupid question here, i looked at the examples but somehow missed the statechange one My bad. Thanks again