A program that will create a movie seat reservation. The program will display the summary seats and its status. The user will be ask what seat no. to be reserved, then it will go back again to the summary to display the updated seat status. If the seat no. is already reserved then it will prompt an error message. And also if the input seat no is out of range then it will also prompt an error message. The program is continuously running. Termination of the program will depends on how the programmer will apply.

Sample output:
Movie Seats Reservation
Summary of Seats:
Seat 1: Available
Seat 2: Available
Seat 3: Available
Seat 4: Available
Seat 5: Available

Enter seat no. (Press 0 to terminate Or the assigned seat capacity) : 1
Movie Seats Reservation
Summary of Seats:
Seat 1: Reserve
Seat 2: Available
Seat 3: Available
Seat 4: Available
Seat 5: Available

Enter seat no. (Press 0 to terminate Or the assigned seat capacity) : 6
The Seat no. is out of range!

Movie Seats Reservation
Summary of Seats:
Seat 1: Reserve
Seat 2: Available
Seat 3: Available
Seat 4: Available
Seat 5: Available

Enter seat no. (Press 0 to terminate Or the assigned seat capacity) : 1
The Seat no. is already reserved!

Movie Seats Reservation
Summary of Seats:
Seat 1: Reserve
Seat 2: Available
Seat 3: Available
Seat 4: Available
Seat 5: Available

Enter seat no. (Press 0 to terminate Or the assigned seat capacity) : 0
GoodBye... Thank You!!!


No Answer is Posted For this Question
Be the First to Post Answer

Post New Answer

More C Code Interview Questions

# include<stdio.h> aaa() { printf("hi"); } bbb(){ printf("hello"); } ccc(){ printf("bye"); } main() { int (*ptr[3])(); ptr[0]=aaa; ptr[1]=bbb; ptr[2]=ccc; ptr[2](); }

1 Answers  


main() { clrscr(); } clrscr();

2 Answers  


String copy logic in one line.

11 Answers   Microsoft, NetApp,


Write a program that find and print how many odd numbers in a binary tree

1 Answers  


how to swap 3 nos without using temporary variable

4 Answers   Satyam,






main() { int *ptr=(int*)malloc(sizeof(int)); *ptr=4; printf("%d",(*ptr)+++*ptr++); }

3 Answers   GNITC,


main() { printf("%d", out); } int out=100;

3 Answers  


why the range of an unsigned integer is double almost than the signed integer.

1 Answers  


Give a one-line C expression to test whether a number is a power of 2.

10 Answers   Microsoft,


main() { char *p; p="%d\n"; p++; p++; printf(p-2,300); }

1 Answers  


#include<stdio.h> main() { struct xx { int x; struct yy { char s; struct xx *p; }; struct yy *q; }; }

2 Answers  


Program to Delete an element from a doubly linked list.

4 Answers   College School Exams Tests, Infosys,


Categories