Gets leaves the newline character in the input buffer. Flushing the input buffer will solve it.
1 2 3 4 5 6 7 8
void get()
{
fflush(stdin);
cout<<"Enter your Name: ";
gets(name);
cout <<"Enter your Marks: ";
cin>>marks;
}
The most recent revision of the C standard (2011) has definitively removed this function from its specification.
The function is deprecated in C++ (as of 2011 standard, which follows C99+TC3).