Problems Displaying keypad input to second row of LCD

Hello,

i am having trouble displaying all of the numbers to the second row of the LCD. I put this in my code:
lcd.setCursor(0, 1); // bottom left but it only displays the numbers one at a time.
How do you fix this?

Thank you

#include <LiquidCrystal.h>
#include <Keypad.h>

LiquidCrystal lcd(22,24,26,28,30,32);



const byte ROWS = 4; // Four rows
const byte COLS = 4; // Four columns

char keys[ROWS][COLS] = {
  {'1','2','3','A'},
  {'4','5','6','B'},
  {'7','8','9','C'},
  {'*','0','#','D'}
};
byte rowPins[ROWS] = { 5,4,3,2}; //connect to the row pinouts of the keypad
byte colPins[COLS] = { 9,8,7,6}; //connect to the column pinouts of the keypad


// Create the Keypad
Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS);
void setup() {
  // put your setup code here, to run once:
Serial.begin(9600);
lcd.begin(16,2);


}

void loop() {

  char key = keypad.getKey();
  
  if (key) { 
     lcd.setCursor(0,1);
    lcd.print(key);
    }
  }

Increment the LCD horizontal position as the numbers are entered.

If you need to operate on the complete number, assemble the number in a variable then *10 then add the next number. etc.

.

How would you do that sir?

sorry I'm new to arduino, please bear with me

Hint:
lcd.setCursor(horizPos,1);
lcd.print(key);
horizPos = horizPos +1;

At some point horizPos would have to be reset to zero again, maybe when you press a *

oh ok Thank you sir