Excellent everybody thankyou
Originally posted by Roopa Bagur:
19. If size = 4, triArray looks like:
int[][] makeArray( int size)
{ int[][] triArray = new int[size] [];
int val=1;
for( int i = 0; i < triArray.length; i++ )
{ triArray[i] = new int[i+1];
for( int j=0; j < triArray[i].length; j++ )
{ triArray[i][j] = val++;
}
}
return triArray;
}
a)
1 2 3 4
5 6 7
8 9
10
b)
1 4 9 16
c)
1 2 3 4
d)
1 2 3 4
5 6 7 8
9 10 11 12
13 14 15 16
e)
1
2 3
4 5 6
7 8 9 10