/**** A program for Airline reservation system
***
**** By +Nullset
***
****/
#include <stdio.h> /* standard input output header file */
#define SIZE_FC 10
#define SIZE_ECO 10
int reserve_fc(void);
int reserve_eco(void);
/* Main function starts here */
int main()
{
int choice;
printf("-----------------------------------------\n");
printf("Welcome to Airline Reservation system\n");
printf("---------------------------------------\n");
printf("Enter choice: 1 for first class , 2 for economy class: ");
scanf("%d", &choice);
/* switch choice */
switch(choice){
case 1 :
reserve_fc(); /* function reserve_fc is called if 1 is input */
break;
case 2 :
reserve_eco(); /* function reserve_eco is called if 2 is input */
break;
default:
printf("Invalid choice\n"); /* The message is displayed if anything else is entered */
break;
}
fflush(stdin); /* Flush the standard input */
getchar(); /* Get a charachter from the user */
return 0; /* Indicate that the function ended successfully */
}
/* Main function ends here */
/* reserve_fc function starts here */
int reserve_fc(void)
{
int fc[SIZE_FC];
int count;
int ticket_number;
printf("You have entered the first class\n");
printf("Please wait while a ticket is issued\n");
printf("Your ticket number is %d", count);
printf("Thank you for using our service\n");
printf("Wishing you a happy journey");
return 0;
}
/* reserve_fc function ends here */
/* reserve_eco function starts here */
int reserve_eco(void)
{
printf("You have entered the economy class\n");
printf("Please wait while a ticket is issued\n");
printf("Thank you for using our service\n");
printf("Wishing you a happy journey\n");
return 0;
}