E CALENDER OF THE YEAR 2007
Category Games and Graphics
Compatibility Turbo C
1: #include<stdio.h>
2: #include<conio.h>
3: void main()
4: {
5: clrscr();
6: int mm;
7: again:
8: gotoxy(20,15);
9: printf("WELCOME TO THE HOME PAGE OF THE E-CALENDER OF THE YEAR 2007");
10: gotoxy(20,20);
11: printf("ENTER MONTH (1-12) : ");
12: scanf("%d",&mm);
13: clrscr();
14: if(mm<1||mm>12)
15: goto again;
16: int days=0;
17: for(int i=1;i<mm;i++)
18: {
19: if(i==1||i==3||i==5||i==7||i==8||i==10)
20: days+=31;
21: else if(i==4||i==6||i==9||i==11)
22: days+=30;
23: else if(i==2)
24: days+=28;
25: }
26: clrscr();
27: switch(mm)
28: {
29: case 1:
30: gotoxy(30,10);
31: printf("JANUARY 2007");
32: break;
33: case 2:
34: gotoxy(30,10);
35: printf("FEBRUARY 2007");
36: break;
37: case 3:
38: gotoxy(30,10);
39: printf("MARCH 2007");
40: break;
41: case 4:
42: gotoxy(30,10);
43: printf("APRIL 2007");
44: break;
45: case 5:
46: gotoxy(30,10);
47: printf("MAY 2007");
48: break;
49: case 6:
50: gotoxy(30,10);
51: printf("JUNE 2007");
52: break;
53: case 7:
54: gotoxy(30,10);
55: printf("JULY 2007");
56: break;
57: case 8:
58: gotoxy(30,10);
59: printf("AUGUST 2007");
60: break;
61: case 9:
62: gotoxy(30,10);
63: printf("SEPTEMBER 2007");
64: break;
65: case 10:
66: gotoxy(30,10);
67: printf("OCTOBER 2007");
68: break;
69: case 11:
70: gotoxy(30,10);
71: printf("NOVEMBER 2007");
72: break;
73: case 12:
74: gotoxy(30,10);
75: printf("DECEMBER 2007");
76: break;
77: }
78: int dd;
79: if(mm==1||mm==3||mm==5||mm==7||mm==8||mm==10||mm==12)
80: dd=31;
81: else if(mm==2)
82: dd=28;
83: else if(mm==4||mm==6||mm==9||mm==11)
84: dd=30;
85: gotoxy(10,15);
86: printf("SUN");
87: gotoxy(18,15);
88: printf("MON");
89: gotoxy(26,15);
90: printf("TUE");
91: gotoxy(34,15);
92: printf("WED");
93: gotoxy(42,15);
94: printf("THU");
95: gotoxy(50,15);
96: printf("FRI");
97: gotoxy(58,15);
98: printf("SAT");
99: int c=0;
100: int k1=0,k2=0,k3=0,k4=0,k5=0,k6=0,k7=0;
101: int line=0;
102: for(int z=1;z<=dd;z=z+1,c=c+1)
103: {
104: days++;
105: int ch=(days-1)%7;
106: switch(ch)
107: {
108: case 0:
109: if(k1==0&&line>0)
110: {
111: k1+=2;
112: gotoxy(19,17+k1);
113: printf("%d",z);
114: }
115: else
116: {
117: gotoxy(19,17+k1);
118: printf("%d",z);
119: }
120: k1+=2;
121: break;
122: case 1:
123: if(k2==0&&line>0)
124: {
125: k2+=2;
126: gotoxy(27,17+k2);
127: printf("%d",z);
128: }
129: else
130: {
131: gotoxy(27,17+k2);
132: printf("%d",z);
133: }
134: k2+=2;
135: break;
136: case 2:
137: if(k3==0&&line>0)
138: {
139: k3+=2;
140: gotoxy(35,17+k3);
141: printf("%d",z);
142: }
143: else
144: {
145: gotoxy(35,17+k3);
146: printf("%d",z);
147: }
148: k3+=2;
149: break;
150: case 3:
151: if(k4==0&&line>0)
152: {
153: k4+=2;
154: gotoxy(43,17+k4);
155: printf("%d",z);
156: }
157: else
158: {
159: gotoxy(43,17+k4);
160: printf("%d",z);
161: }
162: k4+=2;
163: break;
164: case 4:
165: if(k5==0&&line>0)
166: {
167: k5+=2;
168: gotoxy(51,17+k5);
169: printf("%d",z);
170: }
171: else
172: {
173: gotoxy(51,17+k5);
174: printf("%d",z);
175: }
176: k5+=2;
177: break;
178: case 5:
179: gotoxy(59,17+k6);
180: printf("%d",z);
181: k6+=2;
182: line++;
183: break;
184: case 6:
185: if(k7==0&&line>0)
186: {
187: k7+=2;
188: gotoxy(11,17+k7);
189: printf("%d",z);
190: }
191: else
192: {
193: gotoxy(11,17+k7);
194: printf("%d",z);
195: }
196: k7+=2;
197: break;
198: }
199: }
200: getch();
201: }
202:
203:
204:
205:
206:
207:
208:
209:
210:
211:
212:
213:
214:
215:
Post a Comment