Explore BrainMass
Share

Explore BrainMass

    C program to extract month and day from input date string

    This content was COPIED from BrainMass.com - View the original, and get the already-completed solution here!

    Write a C program that accepts a month and day (for example, June 14) from the keyboard as input. Store this information in a string called date. Call a function named separate() passing in the string date and the addresses of a tempmonth array and tempday integer. The separate() function should extract the two values from the passed string and store them into the passed variable addresses. Back in main, print the data in tempmonth and tempday.

    © BrainMass Inc. brainmass.com October 10, 2019, 3:26 am ad1c9bdddf
    https://brainmass.com/computer-science/arrays/c-program-extract-month-day-input-date-string-419991

    Solution Preview

    Please find attached a solution (419991.c) that makes use of sscanf function to separate the month and day from user entered string. Separation can be done in many different ways; since ...

    Solution Summary

    Attached program makes use of sscanf function to separate the month and day from user entered string, however solution also suggests some more ways to achieve the goal.

    $2.19