Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main(void) {
- const int n = 5, m = 10;
- int i, j, a[n][m];
- for (i = 0; i < n; i++)
- for (j = 0; j < m; j++)
- a[i][j] = i;
- puts("Before:");
- for (i = 0; i < n; i++) {
- for (j = 0; j < m; j++)
- printf("%3d ", a[i][j]);
- puts("");
- }
- for (i = 1; i < n; i++)
- a[i - 1][m - 1] = a[i][m - 1];
- puts("After:");
- for (i = 0; i < n; i++) {
- for (j = 0; j < m; j++)
- printf("%3d ", a[i][j]);
- puts("");
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement