Assignment: #yyyymmdd Due: 02/23/02019 Points: 3


Prompt the user to enter a date in the YYYYMMDD format. Example: This program's due date written in YYYYMMDD format is 20180304.

Read the user input into a variable.

Print an error message and exit the program if the user enters a negative number.

Split the YYYYMMDD number into its respective YYYY, MM, DD values using integer division and the modulus operator. [hint: 20100101 / 10000 = 2010 and 20100101 % 10000 = 101]

Print a line that has the following format.


Single digit months and days are prefixed with a zero.

The following are outputs when the inputs 20180314, 19571105, 20380118 are used.

   20180314 is 03/14/2018

   19571105 is 11/05/1957

   20380118 is 01/18/2038