4
I want to do a birth-date registration system. The final question is: as I print the birthday: 1/12/1990, 12/2/1977, 13/09/1999 and 19/04/1987. Would be the examples of the printing of dates, but I appear several numbers that has nothing to do. Follow the code.
#include <stdio.h>
#include <stdlib.h>
typedef struct
{
int dia;
int mes;
int ano;
} data;
int main()
{
data data_aniversario[4];
int i=0;
while (i<4)
{
printf("Preencha sua data de nascimento\n\n");
printf("Digite o dia: ");
scanf("%d", &data_aniversario[i].dia);
printf("\n\nDigite o mes: ");
scanf("%d", &data_aniversario[i].mes);
printf("\n\nDigite o ano: ");
scanf("%d", &data_aniversario[i].ano);
}
printf("\n\nA data do seu aniversário é: \n");
printf("%d/%d/%d\n", data_aniversario.dia, data_aniversario.mes, data_aniversario.ano);
system ("pause");
return 0;
}