To add to this:
You open your Main, but never close it before starting a new method:
malloc(sizeof(student));
void fillnode(struct student *w)
{
if(ans=='y')||(ans=='y')
That is checking for the same things
When you do this:
head=new;
current=new;
you lose all reference to the actual head of the list since each student just contains a reference to the Next student, not the previous.
and, once again, you don't close off a method before starting a new one:
if(ans=='y')||(ans=='y')
{
if(___________)
{
do
while(ans=='Y'||ans=='y')
}}
void printlist(student *h)
You're clearly floundering. You need to outline the different steps to begin with...as in
1.) Read in first student
2.) Ask if they want to continue
3.) Continue reading until they don't want to continue
Then, break that down into steps and code it out instead of just writing without having any clue what you're trying to do.