-
Notifications
You must be signed in to change notification settings - Fork 5
/
program.c
839 lines (752 loc) · 21.2 KB
/
program.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
#include <windows.h>
#include <unistd.h>
#include <stdio.h>
#include <string.h>
#include <stdbool.h>
#include <stdlib.h>
struct StudentInfo
{
char ID[10];
char Name[20];
char Email[30];
char Phone[20];
int NumberOfCourse;
};
struct CourseInfo
{
char StudentID[10];
char Code[10];
char Name[20];
};
struct StudentInfo Students[100];
struct CourseInfo Courses[500];
// some global variables
int i,j;
int TotalStudents = 0;
int TotalCourse = 0;
char StudentID[10];
FILE *AllStudents;
FILE *AllCourses;
FILE *ExistingAllStudents;
FILE *TempAllStudents;
FILE *ExistingAllCourses;
FILE *TempAllCourses;
// end
bool IsRunning = true;
void Menu();
void AddNewStudent();
void ShowAllStudents();
int SearchStudent(char StudentID[10]);
void EditStudent(int StudentFoundIndex);
void DeleteStudent(int StudentIndex);
void DeleteAllStudents();
int IsAlreadyExists(char GivenLine[30],char InfoType, char StudentID[300]);
void ErrorAndRestart(char *Error[100]);
void DeleteCourseByIndex(int CourseIndex);
void DeleteStudentByIndex(int CourseIndex);
void UserGuideline();
void AboutUs();
void GoBackOrExit();
void ExitProject();
void DataSeed();
int main()
{
DataSeed(); // you can comment this line if not want dummy data
while(IsRunning)
{
Menu();
int Option;
scanf("%d",&Option);
switch(Option)
{
case 0:
IsRunning = false;
ExitProject();
break;
case 1:
system("cls");
printf("\n\t\t **** Add A New Student ****\n\n");
AddNewStudent();
GoBackOrExit();
break;
case 2:
system("cls");
printf("\n\t\t **** All Students ****\n\n");
ShowAllStudents();
GoBackOrExit();
break;
case 3:
{
system("cls");
printf("\n\t\t **** Search Students ****\n\n");
printf(" Enter The Student ID: ");
scanf("%s",StudentID);
int IsFound = SearchStudent(StudentID);
if(IsFound<0)
{
printf(" No Student Found\n\n");
}
printf("\n");
GoBackOrExit();
break;
}
case 4:
system("cls");
printf("\n\t\t **** Edit a Student ****\n\n");
printf(" Enter The Student ID: ");
scanf("%s",StudentID);
int StudentFoundIndex = SearchStudent(StudentID);
if(StudentFoundIndex>=0)
{
EditStudent(StudentFoundIndex);
}
else
{
printf(" No Student Found\n\n");
}
GoBackOrExit();
break;
case 5:
system("cls");
printf("\n\t\t **** Delete a Student ****\n\n");
printf(" Enter The Student ID: ");
scanf("%s",StudentID);
int DeleteStudentFoundIndex = SearchStudent(StudentID);
if(DeleteStudentFoundIndex>=0)
{
char Sure = 'N';
getchar();
printf("\n\n");
printf(" Are you sure want to delete this student? (Y/N): ");
scanf("%c",&Sure);
if(Sure == 'Y' || Sure == 'y')
{
DeleteStudent(DeleteStudentFoundIndex);
}
else
{
printf(" Your Data is Safe.\n\n");
GoBackOrExit();
}
}
else
{
printf(" No Student Found\n\n");
GoBackOrExit();
}
break;
case 6:
{
char Sure = 'N';
getchar();
system("cls");
printf("\n\t\t **** Delete ALL Students ****\n\n");
printf(" Are you sure want to delete all the students? (Y/N): ");
scanf("%c",&Sure);
if(Sure == 'Y' || Sure == 'y')
{
DeleteAllStudents();
}
else
{
printf(" Your Data is Safe.\n\n");
GoBackOrExit();
}
break;
}
case 7:
system("cls");
break;
case 8:
system("cls");
UserGuideline();
GoBackOrExit();
break;
case 9:
system("cls");
AboutUs();
GoBackOrExit();
break;
default:
ExitProject();
break;
}
}
return 0;
} // end main function
void Menu()
{
printf("\n\n\t***Student Management System Using C***\n\n");
printf("\t\t\tMAIN MENU\n");
printf("\t\t=======================\n");
printf("\t\t[1] Add A New student.\n");
printf("\t\t[2] Show All students.\n");
printf("\t\t[3] Search A student.\n");
printf("\t\t[4] Edit A student.\n");
printf("\t\t[5] Delete A student.\n");
printf("\t\t[6] Delete All students.\n");
printf("\t\t[7] Clear The window.\n");
printf("\t\t[8] User Guideline.\n");
printf("\t\t[9] About Us.\n");
printf("\t\t[0] Exit the Program.\n");
printf("\t\t=======================\n");
printf("\t\tEnter The Choice: ");
} // end menu
void AddNewStudent()
{
char StudentID[300];
char Name[300];
char Phone[300];
char Email[300];
int NumberOfCourses;
char CourseCode[300];
char CourseName[300];
int IsValidID = 0;
while(!IsValidID)
{
printf(" Enter The ID: ");
scanf("%s",&StudentID);
if(IsAlreadyExists(StudentID,'i',StudentID) > 0)
{
printf(" Error: This ID is already exists.\n\n");
IsValidID = 0;
}
else if(strlen(StudentID) > 10)
{
printf(" Error: ID can not be more than 10 characters.\n\n");
IsValidID = 0;
}
else if(strlen(StudentID) <= 0)
{
printf(" Error: ID can not be empty.\n\n");
IsValidID = 0;
}
else
{
IsValidID = 1;
}
}
int IsValidName = 0;
while(!IsValidName)
{
printf(" Enter The Name: ");
scanf(" %[^\n]s",&Name);
if(strlen(Name) > 20)
{
printf(" Error: Name can not be more than 20 characters.\n\n");
IsValidName = 0;
}
if(strlen(Name) <= 0)
{
printf(" Error: Name can not be empty.\n\n");
IsValidName = 0;
}
else
{
IsValidName = 1;
}
}
int IsValidEmail = 0;
while(!IsValidEmail)
{
printf(" Enter The Email: ");
scanf("%s",&Email);
if(IsAlreadyExists(Email,'e',StudentID) > 0)
{
printf(" This Email is Already Exists.\n");
IsValidEmail = 0;
}
else if(strlen(Email) > 30)
{
printf(" Error: Email can not be more than 30 characters.\n\n");
IsValidEmail = 0;
}
else if(strlen(Email) <= 0)
{
printf(" Error: Email can not be empty.\n\n");
IsValidEmail = 0;
}
else
{
IsValidEmail = 1;
}
}
int IsValidPhone = 0;
while(!IsValidPhone)
{
printf(" Enter The Phone: ");
scanf("%s",&Phone);
if(IsAlreadyExists(Phone,'p',StudentID) > 0)
{
printf(" This Phone Number is Already Exists\n");
IsValidPhone = 0;
}
else if(strlen(Phone) > 20)
{
printf(" Error: Phone can not be more than 20 characters.\n\n");
IsValidPhone = 0;
}
else if(strlen(Phone) <= 0)
{
printf(" Error: Phone can not be empty.\n\n");
IsValidPhone = 0;
}
else
{
IsValidPhone = 1;
}
}
int IsValidNumberOfCourse = 0;
while(!IsValidNumberOfCourse)
{
printf(" Number of courses: ");
scanf("%d",&NumberOfCourses);
if(NumberOfCourses <= 0 || NumberOfCourses > 4)
{
printf(" Error: Number of courses can not be more than 4 and lees than 1.\n\n");
IsValidNumberOfCourse = 0;
}
else
{
IsValidNumberOfCourse = 1;
}
}
strcpy(Students[TotalStudents].ID,StudentID);
strcpy(Students[TotalStudents].Name,Name);
strcpy(Students[TotalStudents].Phone,Phone);
strcpy(Students[TotalStudents].Email,Email);
Students[TotalStudents].NumberOfCourse = NumberOfCourses;
TotalStudents++;
for(i=0; i<NumberOfCourses; i++)
{
printf(" Enter Course %d Code: ",i+1);
scanf("%s",&CourseCode);
printf(" Enter Course %d Name: ",i+1);
scanf(" %[^\n]s",&CourseName);
strcpy(Courses[TotalCourse].StudentID,StudentID);
strcpy(Courses[TotalCourse].Code,CourseCode);
strcpy(Courses[TotalCourse].Name,CourseName);
TotalCourse++;
}
printf("\n Student Added Successfully.\n\n");
}
void ShowAllStudents()
{
printf("|==========|====================|==============================|====================|=============|\n");
printf("| ID | Name | Email | Phone | NO.Course |\n");
printf("|==========|====================|==============================|====================|=============|\n");
for(i=0; i<TotalStudents; i++)
{
printf("|");
printf("%s",Students[i].ID);
for(j=0; j < (10-strlen(Students[i].ID)); j++)
{
printf(" ");
}
printf("|");
printf("%s",Students[i].Name);
for(j=0; j < (20-strlen(Students[i].Name)); j++)
{
printf(" ");
}
printf("|");
printf("%s",Students[i].Email);
for(j=0; j < (30-strlen(Students[i].Email)); j++)
{
printf(" ");
}
printf("|");
printf("%s",Students[i].Phone);
for(j=0; j < (20-strlen(Students[i].Phone)); j++)
{
printf(" ");
}
printf("|");
printf("%d",Students[i].NumberOfCourse);
for(j=0; j < 12; j++)
{
printf(" ");
}
printf("|\n");
printf("|----------|--------------------|------------------------------|--------------------|-------------|\n");
}
printf("\n");
}
int SearchStudent(char StudentID[10])
{
system("cls");
int StudentFoundIndex = -1;
int i;
for(i=0; i<TotalStudents; i++)
{
if(strcmp(StudentID,Students[i].ID) == 0)
{
StudentFoundIndex = i;
printf("\n One Student Found for ID: %s\n\n",StudentID);
printf(" Student Informations\n");
printf("-------------------------\n");
printf(" ID: %s\n",Students[i].ID);
printf(" Name: %s\n",Students[i].Name);
printf(" Email: %s\n",Students[i].Email);
printf(" Phone: %s\n",Students[i].Phone);
printf("\n Total Number of Courses: %d\n",Students[i].NumberOfCourse);
}
}
int CourseCount = 0;
int j;
for(j=0; j<TotalCourse; j++)
{
if(strcmp(StudentID,Courses[j].StudentID) == 0)
{
CourseCount++;
printf(" Course %d Code: %s\n",CourseCount,Courses[j].Code);
printf(" Course %d Name: %s\n",CourseCount,Courses[j].Name);
}
}
return StudentFoundIndex;
}
void EditStudent(int StudentFoundIndex)
{
printf("\n\t\t **** Update The New Student ****\n\n");
char NewName[300];
char NewPhone[300];
char NewEmail[300];
int NewNumberOfCourses;
char StudentID[300];
strcpy(StudentID, Students[StudentFoundIndex].ID);
int OldTotalNumberOfCourse = Students[StudentFoundIndex].NumberOfCourse;
int IsValidName = 0;
while(!IsValidName)
{
printf(" Enter The New Name(0 for skip): ");
scanf(" %[^\n]s",&NewName);
if(strlen(NewName) > 20)
{
printf(" Error: Name can not be more than 20 characters.\n\n");
IsValidName = 0;
}
else if(strlen(NewName) <= 0)
{
printf(" Error: Name can not be empty.\n\n");
IsValidName = 0;
}
else
{
IsValidName = 1;
}
}
int IsValidEmail = 0;
while(!IsValidEmail)
{
printf(" Enter The New Email(0 for skip): ");
scanf("%s",&NewEmail);
if(strlen(NewEmail) > 30)
{
printf(" Error: Email can not be more than 30 characters.\n\n");
IsValidEmail = 0;
}
else if(strlen(NewEmail) <= 0)
{
printf(" Error: Email can not be empty.\n\n");
IsValidEmail = 0;
}
else if(IsAlreadyExists(NewEmail,'e',StudentID) > 0)
{
printf(" Error: This Email Already Exists.\n\n");
IsValidEmail = 0;
}
else
{
IsValidEmail = 1;
}
}
int IsValidPhone = 0;
while(!IsValidPhone)
{
printf(" Enter The New Phone(0 for skip): ");
scanf("%s",&NewPhone);
if(strlen(NewPhone) > 20)
{
printf(" Error: Phone can not be more than 20 characters.\n\n");
IsValidPhone = 0;
}
else if(strlen(NewPhone) <= 0)
{
printf(" Error: Phone can not be empty.\n\n");
IsValidPhone = 0;
}
else if(IsAlreadyExists(NewPhone,'p',StudentID) > 0)
{
printf(" Error: This Phone Number is Already Exists.\n\n");
IsValidPhone = 0;
}
else
{
IsValidPhone = 1;
}
}
int IsValidNumberOfCourse = 0;
while(!IsValidNumberOfCourse)
{
printf(" Number of New courses(0 for skip): ");
scanf("%d",&NewNumberOfCourses);
if(NewNumberOfCourses > 4 || NewNumberOfCourses < 0)
{
printf(" Error: A Student can have maximum 4 and Minimum 0 number of courses.\n\n");
IsValidNumberOfCourse = 0;
}
else
{
IsValidNumberOfCourse = 1;
}
}
if(strcmp(NewName,"0") != 0)
{
strcpy(Students[StudentFoundIndex].Name,NewName);
}
if(strcmp(NewEmail,"0") != 0)
{
strcpy(Students[StudentFoundIndex].Email,NewEmail);
}
if(strcmp(NewPhone,"0") != 0)
{
strcpy(Students[StudentFoundIndex].Phone,NewPhone);
}
if(NewNumberOfCourses != 0)
{
int OldTotalCourse = Students[StudentFoundIndex].NumberOfCourse;
Students[StudentFoundIndex].NumberOfCourse = NewNumberOfCourses;
int FirstCourseIndex;
int dc;
for(dc=0; dc<TotalCourse; dc++)
{
if(strcmp(StudentID,Courses[dc].StudentID) == 0)
{
FirstCourseIndex = dc; // store the index for delete
break;
}
}
// after every delete array index will update (decrease by one)
// we store the courses sequential
// so if we know the first course index and total number of course we can delete all
for(dc=1; dc<=OldTotalCourse; dc++)
{
DeleteCourseByIndex(FirstCourseIndex);
}
char CourseCode[300];
char CourseName[300];
for(i=1; i<=NewNumberOfCourses; i++)
{
printf(" Enter New Course %d Code: ",i);
scanf("%s",&CourseCode);
printf(" Enter New Course %d Name: ",i);
scanf(" %[^\n]s",&CourseName);
strcpy(Courses[TotalCourse].StudentID,StudentID);
strcpy(Courses[TotalCourse].Code,CourseCode);
strcpy(Courses[TotalCourse].Name,CourseName);
TotalCourse++;
}
}
printf(" Student Updated Successfully.\n\n");
}
void DeleteStudent(int StudentIndex)
{
int d;
int FirstCourseIndexs;
struct StudentInfo ThisStudents;
ThisStudents = Students[StudentIndex];
for(d=0; d<TotalCourse; d++)
{
if(strcmp(ThisStudents.ID,Courses[d].StudentID) == 0)
{
FirstCourseIndexs = d;
break;
}
}
for(d=1; d<=ThisStudents.NumberOfCourse; d++)
{
DeleteCourseByIndex(FirstCourseIndexs);
}
DeleteStudentByIndex(StudentIndex);
printf(" Student Deleted Successfully.\n\n");
GoBackOrExit();
}
void DeleteAllStudents()
{
TotalStudents = 0;
TotalCourse = 0;
printf(" All Students Deleted Successfully.\n\n");
GoBackOrExit();
}
void DeleteCourseByIndex(int CourseIndex)
{
int c;
for(c=0; c<TotalCourse-1; c++)
{
if(c>=CourseIndex)
{
Courses[c] = Courses[c+1];
}
}
TotalCourse--;
}
void DeleteStudentByIndex(int CourseIndex)
{
int s;
for(s=0; s<TotalStudents-1; s++)
{
if(s>=CourseIndex)
{
Students[s] = Students[s+1];
}
}
TotalStudents--;
}
int IsAlreadyExists(char GivenLine[300],char InfoType, char StudentID[300])
{
int EmailExists = 0;
int PhoneExists = 0;
int IDExists = 0;
int ep;
for(ep=0; ep<TotalStudents; ep++)
{
if(strcmp(GivenLine,Students[ep].ID) == 0)
{
IDExists++;
}
if(strcmp(GivenLine,Students[ep].Email) == 0 && strcmp(StudentID,Students[ep].ID) != 0 )
{
EmailExists++;
}
if(strcmp(GivenLine,Students[ep].Phone) == 0 && strcmp(StudentID,Students[ep].ID) != 0)
{
PhoneExists++;
}
}
if(InfoType == 'i')
{
return IDExists;
}
else if(InfoType == 'e')
{
return EmailExists;
}
else if(InfoType == 'p')
{
return PhoneExists;
}
else
{
return 0;
}
}
void ErrorAndRestart(char *error[100])
{
printf("%s\n",error);
int i = 0;
printf("Restarting the program: ");
for(i=0; i<10; i++)
{
printf(".");
Sleep(500);
}
system("cls");
main();
}
void UserGuideline()
{
printf("\n\t\t **** How it Works? ****\n\n");
printf(" -> You will only able to store the Student's ID, Name, Email, Phone, Number of Courses.\n");
printf(" -> A student can have maximum 4 courses and minimum 1 course.\n");
printf(" -> Student ID can be maximum 10 characters long and unique for every students.\n");
printf(" -> Student Name can be maximum 20 characters long.\n");
printf(" -> Student Email can be maximum 30 characters long and unique for every students.\n");
printf(" -> Student Phone can be maximum 20 characters long and unique for every students.\n");
printf(" -> Course code can be maximum 10 characters long.\n");
printf(" -> Course Name can be maximum 20 characters long.\n\n");
printf(" ->> visit www.insideTheDiv.com for more project like this. <<-\n\n");
}
void AboutUs()
{
printf("\n\t\t **** About US? ****\n\n");
printf(" Some important note we should remember.\n");
printf(" -> This is a simple student management system project.\n");
printf(" -> You can modify the source code.\n");
printf(" -> You can use this project only for personal purpose not for business.\n\n");
printf(" ->> visit www.insideTheDiv.com for more project like this. <<-\n\n");
}
void GoBackOrExit()
{
getchar();
char Option;
printf(" Go back(b)? or Exit(0)?: ");
scanf("%c",&Option);
if(Option == '0')
{
ExitProject();
}
else
{
system("cls");
}
}
void ExitProject()
{
system("cls");
int i;
char ThankYou[100] = " ========= Thank You =========\n";
char SeeYouSoon[100] = " ========= See You Soon ======\n";
for(i=0; i<strlen(ThankYou); i++)
{
printf("%c",ThankYou[i]);
Sleep(40);
}
for(i=0; i<strlen(SeeYouSoon); i++)
{
printf("%c",SeeYouSoon[i]);
Sleep(40);
}
exit(0);
}
void DataSeed()
{
//-- store some dummy data
//-- student 1
strcpy(Students[0].ID,"S-1");
strcpy(Students[0].Name,"Student 1");
strcpy(Students[0].Phone,"016111111111");
strcpy(Students[0].Email,"student-1@gmail.com");
Students[0].NumberOfCourse=1;
strcpy(Courses[0].StudentID,"S-1");
strcpy(Courses[0].Code,"CSE-1");
strcpy(Courses[0].Name,"Course - 1");
//-- student 2
strcpy(Students[1].ID,"S-2");
strcpy(Students[1].Name,"Student 2");
strcpy(Students[1].Phone,"016111111112");
strcpy(Students[1].Email,"student-2@gmail.com");
Students[1].NumberOfCourse=2;
strcpy(Courses[1].StudentID,"S-2");
strcpy(Courses[1].Code,"CSE-1");
strcpy(Courses[1].Name,"Course - 1");
strcpy(Courses[2].StudentID,"S-2");
strcpy(Courses[2].Code,"CSE-2");
strcpy(Courses[2].Name,"Course - 2");
//-- student 3
strcpy(Students[2].ID,"S-3");
strcpy(Students[2].Name,"Student 3");
strcpy(Students[2].Phone,"016111111113");
strcpy(Students[2].Email,"student-3@gmail.com");
Students[2].NumberOfCourse=3;
strcpy(Courses[3].StudentID,"S-3");
strcpy(Courses[3].Code,"CSE-1");
strcpy(Courses[3].Name,"Course - 1");
strcpy(Courses[4].StudentID,"S-3");
strcpy(Courses[4].Code,"CSE-2");
strcpy(Courses[4].Name,"Course - 2");
strcpy(Courses[5].StudentID,"S-3");
strcpy(Courses[5].Code,"CSE-3");
strcpy(Courses[5].Name,"Course - 3");
TotalStudents = 3;
TotalCourse = 6;
}