title: How to scan a "0" on the months that have one digit?
body: <p>I am doing this C program where I need to input a date and see whether it is a valid date. However, I do not know how to scan a "0" in front of the days and months that have one digits. Also, the program requires to scan "/" as well. If the user inputs "07-14-1999" it has to be invalid because the user did not input "/". What should I do with these two problems? The following is the code I have so far. Thank you.</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  
  int main()
  {
      int day, month, year;
      printf("Please enter a date to check validity (in the form of MM/DD/YYYY): ");
      scanf("%i%i/%i%i/%i%i",&amp;month, &amp; month, &amp;day, &amp;day, &amp;year, &amp;year, &amp;year &amp;year);
  
  
      printf("%i%i/%i%i/%i%i",month, month, day, day, year, year, year, year);
  
  
  }
  </code></pre>