title: Why the first printf doesn't work while the other two works with the same structure?
body: <pre><code>#define _CRT_SECURE_NO_WARNINGS
  
  #include &lt;stdio.h&gt;
  
  int main (void)
  { 
      struct Numbers
      {
          char cell[21];
          char home[21];
          char business[21];
      };
  
      // Declare variables here:
  
      struct Numbers numbers;
      char prompt;
  
      printf("Do you want to enter a cell phone number? (y or n): ");
      scanf("%s", &amp;prompt);
      if (prompt == 'y' || prompt == 'Y')
      {
          printf("Please enter the contact's cell phone number: ");
          scanf("%s", numbers.cell);
      }
  
      printf("Do you want to enter a home phone number? (y or n): ");
      scanf("%s", &amp;prompt);
      if (prompt == 'y' || prompt == 'Y')
      {
          printf("Please enter the contact's home phone number: ");
          scanf("%s", numbers.home);
      }
  
      printf("Do you want to enter a business phone number? (y or n): ");
      scanf("%s", &amp;prompt);
      if (prompt == 'y' || prompt == 'Y')
      {
          printf("Please enter the contact's business phone number: ");
          scanf("%s", numbers.business);
      }
  
      printf("\n");
  
      printf("Phone Numbers:");
      printf("\n");
      printf("Cell phone number: %s", numbers.cell);
      printf("\n");
      printf("Home phone number: %s", numbers.home);
      printf("\n");
      printf("Business phone number: %s", numbers.business);
      printf("\n");
  
      printf("Structure test for Name, Address, and Numbers Done!");
  
      return 0;
  }
  </code></pre>
  
  <p>Here is how the output looks like:
  <a href="https://i.stack.imgur.com/8GgPH.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8GgPH.jpg" alt="enter image description here"></a>  </p>
  
  <p>The cell phone number is empty while home phone and business phone work.
  Once I made a mistake input as y->12345->y->12345->y12345->12345, then all 3 numbers show correctly. I can't find what's the problem.</p>
  
  <p>Result for mistaken input:
  <a href="https://i.stack.imgur.com/eHvLK.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/eHvLK.jpg" alt="enter image description here"></a></p>