Skip to content

Instantly share code, notes, and snippets.

@WizzyGeek
Created August 3, 2023 03:58
Show Gist options
  • Save WizzyGeek/2b1299d9765cdca9780d636a0f37c1df to your computer and use it in GitHub Desktop.
Save WizzyGeek/2b1299d9765cdca9780d636a0f37c1df to your computer and use it in GitHub Desktop.
#include"stdio.h"
void iota(int *arr, int len) {
for (int i = 0; i < len; i++) {
arr[i] = i;
}
}
int main() {
int a[4][4];
iota(a, 16);
int m = a[0][0];
int mr = 0, mc = 0;
for (int i = 0; i < 4; i++)
for (int j = 0; j < 4; j++)
if (a[i][j] > m) {m = a[i][j]; mr = i; mc = j;};
printf("%d %d", mr, mc);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment