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

Is the following code legal? struct a { int x; struct a b; }

1 Answers  


int aaa() {printf(“Hi”);} int bbb(){printf(“hello”);} iny ccc(){printf(“bye”);} main() { int ( * ptr[3]) (); ptr[0] = aaa; ptr[1] = bbb; ptr[2] =ccc; ptr[2](); }

1 Answers  


How to palindrom string in c language?

6 Answers   Google,


main(){ unsigned int i; for(i=1;i>-2;i--) printf("c aptitude"); }

2 Answers  


main() { char *p = “ayqm”; printf(“%c”,++*(p++)); }

29 Answers   IBM, TCS, UGC NET, Wipro,






main() { int i=1; while (i<=5) { printf("%d",i); if (i>2) goto here; i++; } } fun() { here: printf("PP"); }

1 Answers  


How will u find whether a linked list has a loop or not?

8 Answers   Microsoft,


struct Foo { char *pName; }; main() { struct Foo *obj = malloc(sizeof(struct Foo)); clrscr(); strcpy(obj->pName,"Your Name"); printf("%s", obj->pName); } a. Your Name b. compile error c. Name d. Runtime error

3 Answers   HCL,


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

2 Answers  


struct Foo { char *pName; char *pAddress; }; main() { struct Foo *obj = malloc(sizeof(struct Foo)); clrscr(); obj->pName = malloc(100); obj->pAddress = malloc(100); strcpy(obj->pName,"Your Name"); strcpy(obj->pAddress, "Your Address"); free(obj); printf("%s", obj->pName); printf("%s", obj->pAddress); } a. Your Name, Your Address b. Your Address, Your Address c. Your Name Your Name d. None of the above

2 Answers   HCL,


#include<conio.h> main() { int x,y=2,z,a; if(x=y%2) z=2; a=2; printf("%d %d ",z,x); }

1 Answers  


main() { int i; printf("%d",scanf("%d",&i)); // value 10 is given as input here }

2 Answers   IBM,


Categories