can sumbody please explain me the following calendar code(i got this from here only)????
CODE
#include<iostream.h>
#include<conio.h>
int leapyr(int k);
void display(int p,int q, int r);
void main()
{clrscr();
int y,m,j,a[13]={0,3,6,7,3,5,1,3,6,2,4,7,2};
yr: cout<<"enter any yr btw 1980 and infinity(in no.s)"<<endl;
cin>>y;
if(y<1980)
goto yr;
mn: cout<<"enter its month"<<endl;
cin>>m;
if(m<1||m>12)
goto mn;
if(m<3)
for(j=1981;j<=y;j++)
{a[m]=a[m]+leapyr(j-1)+1;
if(a[m]>7)
a[m]=a[m]-7;
}
else
for(j=1981;j<=y;j++)
{a[m]=a[m]+leapyr(j)+1;
if(a[m]>7)
a[m]=a[m]-7;
}
cout<<a[m];
display(y,m,a[m]);
getch();
}
int leapyr(int k)
{ if(k%400==0)
return 1;
else
if(k%100==0)
return 0;
else
if(k%4==0)
return 1;
else
return 0;
}
void display(int p,int q,int r)
{int a[6][7],b,i,j,n;
clrscr();
if(q==1||q==3||q==5||q==7||q==8||q==10||q==12)
b=31;
if(q==4||q==6||q==9||q==11)
b=30;
if(q==2)
b=28+leapyr(p);
cout<<" s m t w th fr sa"<<'\n';
n=2-r;
for(i=0;i<6;i++)
{for(j=0;j<7;j++)
{a[i][j]=n;
n++;
gotoxy((j+1)*4,i+2);
if(a[i][j]<1||a[i][j]>b)
cout<<" ";
else
cout<<a[i][j];
}}
}
plz explain all the processing... i'll be really grateful...