6. Assignment 5
WAP to implement fragments using Array of Pointers
Input: Read number of rows and no of columns for each row and
read elements for each row
7. Assignment 5
WAP to implement fragments using Array of Pointers
Input: Read number of rows and no of columns for each row and
read elements for each row
Output:
8. Assignment 5
WAP to implement fragments using Array of Pointers
Input: Read number of rows and no of columns for each row and
read elements for each row
Output: Calculate average for each row separately and sort
each row based on average and print row elements
12. Examples:-
Read Number of elements/columns in each rows/fragment.
Assume in 1st row = 3 elements/columns
2nd row = 2 elements/columns
3rd row = 4 elements/columns
Assignment 5
1000
2000
3000
500
504
508
1000 1008
1004
2000 2004
3000 3012
3008
3004
13. Examples:-
Allocate one extra column for storing average of each row.
Assignment 5
500
504
508
1000 1008
1004
2000 2004
3000 3012
3008
3004
1000
2000
3000
14. Examples:-
Initialize one more array to store number of columns in each
row.
Assignment 5
500
504
508
1000 1008
1004
2000 2004
3000 3012
3008
3004
1000
2000
3000
4 3 5
int arr
15. Examples:-
Read the elements in each row.
Assignment 5
500
504
508
30 5 18
12 6
1 8 6 2
1000 1008
1004
2000 2004
3000 3012
3008
3004
1000
2000
3000
4 3 5
int arr
16. Examples:-
Calculate the average for each row and store it in last index of
each row.
Assignment 5
500
504
508
30 5 18 17.6
12 6 9
1 8 6 2 4.25
1000 1008
1004
2000 2004
3000 3012
3008
3004
1000
2000
3000
4 3 5
int arr
17. Examples:-
Compare the average of each row and sort the rows
accordingly.
Assignment 5
500
504
508
30 5 18 17.6
12 6 9
1 8 6 2 4.25
1000 1008
1004
2000 2004
3000 3012
3008
3004
1000
2000
3000
Swap 3000
and 1000
4 3 5
int arr
18. Examples:-
Compare the average of each row and sort the rows
accordingly.
Assignment 5
500
504
508
30 5 18 17.6
12 6 9
1 8 6 2 4.25
1000 1008
1004
2000 2004
3000 3012
3008
3004
3000
2000
1000
5 3 4
int arr