code for airline reservation using linked list
#1

hi i am satyam i would like to know the code for airline reservation usin linked list in c language .
Reply
#2
Below is the code to make the reservation and delete a reservation.

Code:
void new_reservation()
{
   curr = start;
   if (start == NULL)
   {
       //Empty list
       start = curr = (struct passenger *)malloc(sizeof(struct passenger));
       dataentry();
       curr->next = NULL;
       printf("\n\t Reservation successful");
       return;
   }
   //Reach end of list


   while (curr->next)
       curr = curr->next;
   curr->next = (struct passenger *)malloc(sizeof(struct passenger));
   curr = curr->next;
   dataentry();
   curr->next = NULL;
   printf("\n\t Reservation successful");
   printf("\n\t Saved to Reservation list");
}

void del()
{
   struct passenger *temp; // assigning a temporary pointer to struct airplane
   char str[20];
   printf("Enter phone number:");

   gets(str);
   fflush(stdin);
   curr = start;
   while (curr)
   {
       if (strcmp(start->Phone, str) == 0)
       {
           temp = start;
           start = start->next;
           free(temp);
           return;
       }
       if (strcmp(curr->next->Phone, str) == 0)
       {
           temp = curr->next;
           curr->next = curr->next->next;
           free(temp);
           break;
       }
       else if (strcmp(curr->next->Phone, str) != 0)
       {
           printf("\n\n No reservations found!!");
           break;
       }
   }
   printf("\n\n Deletion successful!!");
}
Reply
#3

Below is the code to make the reservation and delete a reservation.

Code:
void new_reservation()
{
   curr = start;
   if (start == NULL)
   {
       //Empty list
       start = curr = (struct passenger *)malloc(sizeof(struct passenger));
       dataentry();
       curr->next = NULL;
       printf("\n\t Reservation successful");
       return;
   }
   //Reach end of list


   while (curr->next)
       curr = curr->next;
   curr->next = (struct passenger *)malloc(sizeof(struct passenger));
   curr = curr->next;
   dataentry();
   curr->next = NULL;
   printf("\n\t Reservation successful");
   printf("\n\t Saved to Reservation list");
}

void del()
{
   struct passenger *temp; // assigning a temporary pointer to struct airplane
   char str[20];
   printf("Enter phone number:");

   gets(str);
   fflush(stdin);
   curr = start;
   while (curr)
   {
       if (strcmp(start->Phone, str) == 0)
       {
           temp = start;
           start = start->next;
           free(temp);
           return;
       }
       if (strcmp(curr->next->Phone, str) == 0)
       {
           temp = curr->next;
           curr->next = curr->next->next;
           free(temp);
           break;
       }
       else if (strcmp(curr->next->Phone, str) != 0)
       {
           printf("\n\n No reservations found!!");
           break;
       }
   }
   printf("\n\n Deletion successful!!");
}
Reply

Important Note..!

If you are not satisfied with above reply ,..Please

ASK HERE

So that we will collect data for you and will made reply to the request....OR try below "QUICK REPLY" box to add a reply to this page
Popular Searches: wow tmorph code list, implementation a dictionary using linked list in datastructures, bank managment project in c using linked list, library management using linked list code in c, airline reservation system project using linked list stack queue, code for airline reservation using linked list, linked list program using c of airlince,

[-]
Quick Reply
Message
Type your reply to this message here.

Image Verification
Please enter the text contained within the image into the text box below it. This process is used to prevent automated spam bots.
Image Verification
(case insensitive)

Possibly Related Threads...
Thread Author Replies Views Last Post
  Require Price List of Nerolac Paint 0 4,263 29-02-2020, 01:20 PM
Last Post:
  list of seminar topics in botany 0 6,564 06-11-2018, 04:25 PM
Last Post: Guest
  bus ticket reservation project pdf 0 1,460 23-10-2018, 10:01 PM
Last Post: Guest
  qtp flight reservation application download 0 576 22-10-2018, 12:08 PM
Last Post: Guest
  program for ticket reservation using multithreading in java 0 1,067 08-10-2018, 10:00 AM
Last Post: Guest
  reservation program using queue in c 0 598 04-10-2018, 07:58 PM
Last Post: Guest
  algorithm of railway reservation system 0 669 02-10-2018, 10:50 PM
Last Post: Guest
  mechanical engineering companies list pdf 0 745 27-09-2018, 11:25 AM
Last Post: Guest
  spare parts of hero honda pleasure list pdf 0 658 20-09-2018, 11:41 PM
Last Post: Guest
  krishi bikash shilpa kendra recruitment panel list 0 805 19-08-2018, 09:22 PM
Last Post: Guest

Forum Jump: