please help me identifying the problem in the following program's do while loop.
Code:
#include<stdio.h> //implemening double linked list
typedef struct _auistud{
char name[20];
int gpa,id;
struct _auistud *next;
struct _auistud *previous;
}auistud;
int
main(void){
auistud *_new,*rear,*head;
char ans;
_new=(auistud*)malloc(sizeof(auistud));
printf("please enter the name\n");
scanf("%s",_new->name);
printf("please enter the id\n");
scanf("%d",&_new->id);
printf("please enter the gpa\n");
scanf("%d",&_new->gpa);
head=_new;
rear=head;
do{
_new=(auistud*)malloc(sizeof(auistud));
printf("please enter the name\n");
scanf("%s",_new->name);
printf("please enter the id\n");
scanf("%d",&_new->id);
printf("please enter the gpa\n");
scanf("%d",&_new->gpa);
rear->next=_new;
_new->previous=rear;
printf("please enter yes or no\n");
scanf("%c",&ans);
}while(ans=='y');
rear->next=NULL;
return(0);
}