you just have to make following change in your structure.....your progam will surely run....
you can use "getch();" to make output wait till you press any key...
it is included in <conio.h>
hope it will work....
struct student
{
char name[10];
char dep[10];
char course[10];
int roll;
int year;
};