Print numbers 0, 1, 2, ...,userNum as shown, with each number indented by that number of spaces.
Question:
Print numbers 0, 1, 2, ...,userNum as shown, with each number indented by that number of spaces. For each printed line, print the leading spaces, then the number, and then a newline. Hint: Use i and j as loop variables (initialize i and j explicitly). Note: Avoid any other spaces like spaces after the printed number. Ex: userNum = 3 prints:
0
1
2
3
Sample program:
#include <stdio.h>
int main(void) {
intuserNum = 0;
inti = 0;
int j = 0;
<STUDENT CODE>
return 0;
}
Given variables numRows and numCols (type int, already initialized), print a list of all seats in a theater. Rows are numbered, columns lettered, as in 1A or 3E. Variables already defined for your use are: intcurrRow, intcurrCol, and char currColLet. Print a space after each seat, including the last. Example output for numRows = 2 and numCols = 3:
1A 1B 1C 2A 2B 2C