Program for Enqueue in Link List with c program
Queue Enqueue Dequeue in link list |
// TIME: 10.53PM, Date: 16-11-16, Created by Md. Sohidul Islam Shoikat.
// Link List Queue Enqueue and Dequeue :
//Program 1: Link List Enqueue:
#include<stdio.h>
main()
{
int f=0,r=0,n=6;
int q[6];
int item;
while(1)
{
printf("enter a value: ");
scanf("%d",&item);
r=(r+1)%6;
if(r==f)
{
r=(r-1)%6;
printf("the queue is full.\nand r=%d",r);
}
else
q[r]=item;
printf("the input value is: %d \nand the index number is: %d\n",item,r);
}
}
0 comments:
Post a Comment