MENU
Question -

Write a function SKIPEACH(int H[] [3], int C, int R) in C+ + to display all alternate elements from two-dimensional array H (starting from H [0] [0]).
For example:
If the array is containing:
12 45 67
33 90 76
21 43 59
The output will be
12 67 90 21 59



Answer -

void SKIPEACH (int H[ ] [3], int C, int R)
 {
 for (int i = 0; i C; i + + )
 { for (int j = 0, j < R; j++)
 {
 if ( (i + j)%2 = =0)
 cout<
 }
 }

Comment(S)

Show all Coment

Leave a Comment

Free - Previous Years Question Papers
×