A simple approach is to read the input as a string, e.g., using fgets. Then, attempt to parse this string using sscanf with "%d/%d/%d" as the format specifier, checking that the return value is 3. If it isn't, attempt to parse the string using sscanf with "%d-%d-%d" as the format specifier, checking for a return value of 3. If it isn't, the input is invalid. Otherwise, check that the values read are within the expected ranges.
Alternatively, you can consider using regular expressions, if such a library is available to you. For example, you could read the input as a string using fgets, remove the trailing newline, then attempt to parse it using regex with the PCRE pattern:
Code:
^(\d{2}/\d{2}/\d{4})|(\d{2}-\d{2}-\d{4})$
You would still need to validate the ranges though.