Solution:

struct Node* insertNodeAtMiddle(struct Node *head, int data)
{
    struct Node *Previous,*Next,*temp=head;
    int noOfNodes=0;
    while(temp->next!=head){
        noOfNodes+=1;
        temp=temp->next;
    }
    noOfNodes+=1;
    Previous=getNode(head,noOfNodes/2);
    Next=Previous->next;
    struct Node *newNode=(struct Node*)malloc(sizeof(struct Node));
    newNode->data=data;
    newNode->next=Next;
    newNode->prev=Previous;
    Previous->next=newNode;
    Next->prev=newNode;
    return head;
}