Addition of numbers using button won't work

UKHeliBob:
Unless you want the number to increase rapidly when you get the program working you will need to detect when the button becomes pressed rather than when it is pressed. See the StateChangeDetection eaxmple in the IDE.

As to the problem, this

  int number = 1;

sets number back to 1 each time through loop()
Either make it a global variable and remove int or add the word static to the front of its declaration.

I made it a global variable and removed int and it says " number was not declared in this scope ", and also adding static and leaving it under loop, gives the same error and also with "does not name a type".