I am not getting the desired output from this program.
It should print out the entered Month and Day after the user enters at the prompt.
Code:
#include <stdio.h>
#include <string.h>
#define LSIZE 81
void seperate();
int main()
{
char date[LSIZE];
char tempmonth[15];
int tempday;
printf("Enter a Month and Day (ex. Februaury 15) :");
sscanf(date, "%s %d", &tempmonth, &tempday);
seperate (date);
printf("The Month you entered was %c\n", tempmonth);
printf("The Day you entered was %d\n", tempday);
return 0;
}
void seperate(char strng[])
{
int i = 0;
char c;
while (i< (LSIZE-1) && (c = getchar()) != '\n')
{
strng[i] = c;
i++;
}
strng[i] = '\0';
}