Question: This is a part of my program that i wrote in c language , its the seat selection function , its super messy and i

 This is a part of my program that i wrote inc language , its the seat selection function , its super messy

This is a part of my program that i wrote in c language , its the seat selection function , its super messy and i dont know how to make it neat and easy to understand, i have abunch of forloops and if statements in a while loop, theres even a while loop inside a while loop..

int seat sel) char seats[R_SIZE][C SIZE]; int r, c, num seat, row sel, col sel; printf(n printf(tt FLIGHT SEAT PLAN nititltColumn ") printf("It 1lt 21t 3\t 41t 5 nin") for (r = 0; r" scanf("%d", &num-seat); if (num, seat printf("n--Booked seats are shown as x " printf(" B-BUSINESS, E-ECONOMY n" printf(" Enter row(1-10) and column (1-5) for %d seat >", num-seat); else if (num, seat 2) { main menu) system("cls") else printf("n printf("You are only allowed to reserve 1 seat at a time,please try again ") break for (r scanf("%d%d", r++) sel, { &col 0; rnum-seat; = &row sel); int seat sel) char seats[R_SIZE][C SIZE]; int r, c, num seat, row sel, col sel; printf(n printf(tt FLIGHT SEAT PLAN nititltColumn ") printf("It 1lt 21t 3\t 41t 5 nin") for (r = 0; r" scanf("%d", &num-seat); if (num, seat printf("n--Booked seats are shown as x " printf(" B-BUSINESS, E-ECONOMY n" printf(" Enter row(1-10) and column (1-5) for %d seat >", num-seat); else if (num, seat 2) { main menu) system("cls") else printf("n printf("You are only allowed to reserve 1 seat at a time,please try again ") break for (r scanf("%d%d", r++) sel, { &col 0; rnum-seat; = &row sel)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!