can someone tell me whats wrong with this codes, because there's some error in printing..
#include<stdio.h>
#include<iostream.h>
struct bday{
char month[2];
char date[2];
char year[4];
};
struct contacts{
char surname[10];
char phoneno[12];
};
void main(void)
{
struct contacts con[2];
struct bday bd[2];
int i;
for(i=0;i<=2;i++)
{
cout<<"\nSurname : ";
cin>>con[i].surname;
cout<<"Phone number : ";
cin>>con[i].phoneno;
cout<<"Birthday month: ";
cin>>bd[i].month;
cout<<"Birthday date : ";
cin>>bd[i].date;
cout<<"Birthday year : ";
cin>>bd[i].year;
}
for(i=0;i<=2;i++)
{
cout<<"\nContact #"<<i<<"surname :"<<con[i].surname;
cout<<"\nContact #"<<i<<"phone number: "<<con[i].phoneno;
cout<<"\nContact #"<<i<<"Birthday : "<<bd[i].month<<"/"<<bd[i].date<<"/"<<bd[i].year;
cout<<"\n\n";
}
}