int z;
    declares variable z.  You initialize a variable
    when you store a value into it for the first time.  In lines
  int z;
  z = 0;
    the second line initializes z.  You can combine
    declaring and initializing a variable, as in
  int z = 0;