Lowe’s reported quarterly results that beat expectations but gave a downbeat full-year outlook a day after rival Home Depot did the same.