In: Computer Science
SOLVE IN C: Given numRows and numColumns, print a list of all seats in a theater. Rows are numbered, columns lettered, as in 1A or 3E. Print a space after each seat, including after the last. Ex: numRows = 2 and numColumns = 3 prints:
1A 1B 1C 2A 2B 2C
#includeint main() { int numRows; int numColumns; int currentRow; int currentColumn; char currentColumnLetter; // Read number of rows scanf("%d", &numRows); // Read number of columns scanf("%d", &numColumns); // Value of currentRow running from 1 to numRows for(currentRow=1; currentRow<= numRows; currentRow++) { // Value of currentColumn running from ascii value from A for(currentColumn=65; currentColumn <= 65 + numColumns -1; currentColumn++) { // Converting integer currentColumn to char currentColumnLetter = currentColumn; // Printing Value of currentRow and currentColumnLetter printf("%d%c ",currentRow,currentColumnLetter); } } // Printing new line at the end printf("\n"); return 0; }