help Serial communication

I’m having a bit of a problem here.
I want to repeat printing “zzzZZZ” and print only “WHO ARE YOU?” once.
I want to terminate the loop “zzzZZZ” by typing 1 to the Serial Monitor and displaying the task under the condition val == 1.

What am i missing?

void setup()
{
  Serial.begin(9600);
}

void loop()
{
  while(Serial.available() == 0);
  int val = Serial.read() - '0';
  
  if(val == 0)
  {
    Serial.println("WHO ARE YOU?");
    while()                             <========== at this part
    {
      Serial.println("zzzZZZ");
    }
  }
  else if(val == 1)
  {
    Serial.println("I'm ONE");
  }
  if(val == 2)
  {
    Serial.println("I'm TWO");
  }
  else if(val == 3)
  {
    Serial.println("I'm THREE");
  }
  Serial.flush();
}

nevermind.
I got it. :slight_smile:

So maybe you will have time to read the how to use this forum sticky at the top of the page and post the code correctly.