Output not coming

#include
using namespace std;
struct node{
int data;
struct nodenext;
};
struct node
front=0;
struct noderear=0;
void enqueue(int x)
{
struct node
newnode;
newnode=(struct node*)malloc(sizeof(struct node));
newnode->data=x;
newnode->next=0;
if(front==0&&rear==0)
{
rear=front=newnode;
}
else
{
rear->next=newnode;
rear=newnode;
}
}
void display()
{
struct node*temp;
if(front==0&&rear==0)
{
cout<<“empty queue”;
}
else
{
temp=front;
while(temp!=0)
{
cout<next;
temp=temp->next;
}
}
}
int main()
{
enqueue(5);
enqueue(6);
enqueue(7);
display();
}

Hi @supratik260699
Your code is not printing data of linked list because in the display function you are printing temp->next; instead you should print temp->data;

Here is your corrected code :