Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- const int NUMBER_OF_ROW = 4;
- const int NUMBER_OF_COLUMNS = 5;
- void largestINRow(int arr[][NUMBER_OF_COLUMNS], int row)
- {
- int i = 0;
- int j ;
- int max = 0;
- int output[NUMBER_OF_ROW];
- while (i < NUMBER_OF_ROW)
- {
- for (j = 0; j < NUMBER_OF_COLUMNS; j++)
- {
- if (arr[i][j] > max)
- max = arr[i][j];
- }
- output[i] = max;
- cout << max<<endl;
- max = 0;
- i++;
- }
- }
- void main()
- {
- int board[NUMBER_OF_ROW][NUMBER_OF_COLUMNS] = { {23,5,-6,15,-18},{4,16,24,67,-10},
- {-12,54,23,76,11},{-1,12,34,22,8} };
- largestINRow(board, NUMBER_OF_ROW);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement