Post-Lab: Quiz
Q1. Using two for loops to initialize the two-dimensional array “table” with the values stored in the array using the formula (x+y*4). Where x is the outer for loop and y is the inter for loop. The 2-D array will have a size of 10X10.
Q2. Write a program to display the contents of the array in a triangular format. The array declared in the program should be a multi-dimensional ragged array such as 2-D with rows equal to 10 and unequal number of columns. The program will display the outputs in following manner:
Output:
|
0 |
|
|
|
|
|
|
|
|
|
|
0 |
0 |
|
|
|
|
|
|
|
|
|
0 |
0 |
0 |
|
|
|
|
|
|
|
|
0 |
0 |
0 |
0 |
|
|
|
|
|
|
|
0 |
0 |
0 |
0 |
0 |
|
|
|
|
|
|
0 |
0 |
0 |
0 |
0 |
0 |
|
|
|
|
|
0 |
0 |
0 |
0 |
0 |
0 |
0 |
|
|
|
|
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
|
|
|
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
|
|
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |