You are on page 1of 1

Q 1 Write a function SORTPOINTS() in c++ to sort an array of structure game

in descending order of points using bubble sort ?


Q 2 Define a function SWAPCOL() in c++ to swap (interchange) the first column
elements with the last column elements, for a two dimensional integer array
passed as the argument of the function ?
Q 3 Write a function in c++ wich accepts an integer array and its size as
arguments and swaps the elements of every even location with its following
odd loacations .?
EXAMPLE : if an array initially contains an elemeent as
2,4,1,6,5,7,9,23,10
then the function should rearrange the array as
4,2,6,1,7,5,23,9,10
Q 4 Write a function in c++ to print the product of each row of a two
dimensional integer array passed as the argument of the function.
EXPLAIN : if the two dimensional array contains
20 40 10
40 50 30
60 30 20
40 20 30
then the output should appear as :
Product of Diagonal 1 = (1*5*2*4)=40
Product of Diagonal 2 = (3*6*3*2)=108

Q 5 Write a function in c++ wich accepts an integer array and its size as
parameters and rearranges the array in reverse . ?
EXAMPLE : 4,2,5,1,6,7,8,12,10
then the function should rearrange the array as
10,12,8,7,6,1,5,2,4
Q 6 Write a function in c++ to print the product of each column of a two dimensi
onal
integer array passed as the argument of the function
EXPLAIN : if the two dimensional array cotains
1 2 4
3 5 6
4 3 2
2 1 5
then the output shuld appear as :
Product of column 1 =24
Product of column 2 =30
Product of column 3 =240

You might also like