Traverse Matrix in Diagonal strips
Here’s something you can use. Just replace the printfs with what you actually want to do. #include <stdio.h> int main() { int x[3][3] = {1, 2, 3, 4, 5, 6, 7, 8, 9}; int n = 3; for (int slice = 0; slice < 2 * n – 1; ++slice) { printf(“Slice %d: “, slice); … Read more