The code is something like this:
Code:
#include<stdio.h>
int main()
{
void date(int,int *,int *,int *);
int x,year,month,day;
printf("Enter a date in yyyymmdd: ");
scanf("%d",&x);
date(x,&year,&month,&day);
printf("\nThe year is %d",year);
printf("\nThe month is %d",month);
printf("\nThe day is %d",day);
return 0;
}
void date(int z,int *y,int *m,int *d)
{
*y=(something will make it only display first 4 number)
*m=(something will make it only display middle 2 number)
*d=(something will make it only display last 2 number)
}