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

main() { int i=10; void pascal f(int,int,int); f(i++,i++,i++); printf(" %d",i); } void pascal f(integer :i,integer:j,integer :k) { write(i,j,k); }

1 Answers  


Write a C program to print look and say sequence? For example if u get the input as 1 then the sequence is 11 21 1211 111221 312211 12112221 .......(it counts the no. of 1s,2s etc which is in successive order) and this sequence is used in run-length encoding.

1 Answers  


main(int argc, char **argv) { printf("enter the character"); getchar(); sum(argv[1],argv[2]); } sum(num1,num2) int num1,num2; { return num1+num2; }

1 Answers  


#include<stdio.h> main() { int a[2][2][2] = { {10,2,3,4}, {5,6,7,8} }; int *p,*q; p=&a[2][2][2]; *q=***a; printf("%d..%d",*p,*q); }

1 Answers  


Cluster head selection in Wireless Sensor Network using C programming language.

0 Answers  






what is brs test reply me email me kashifabbas514@gmail.com

0 Answers  


source code for delete data in array for c

1 Answers   TCS,


main() { int i = 257; int *iPtr = &i; printf("%d %d", *((char*)iPtr), *((char*)iPtr+1) ); }

1 Answers   CSC,


writte a c-programm to display smill paces

2 Answers  


#if something == 0 int some=0; #endif main() { int thing = 0; printf("%d %d\n", some ,thing); }

1 Answers  


Display the time of the system and display the right time of the other country

1 Answers  


What is the subtle error in the following code segment? void fun(int n, int arr[]) { int *p=0; int i=0; while(i++<n) p = &arr[i]; *p = 0; }

1 Answers  


Categories