Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int main()
- {
- //int nx, ny, ng;
- int nx = 4;
- int ny = 5;
- int ng = 3;
- //scanf_s("%d %d %d", &nx, &ny, &ng);
- int arr[100][100];
- int i, j;
- for (i = 0; i < nx; i++) {
- for (j = 0; j <ny; j++) {
- scanf_s("%d", &arr[i][j]);
- }
- }
- printf("Two Dimensional array elements:\n");
- for (i = 0; i < nx; i++) {
- for (j = 0; j <ny; j++) {
- printf("%d ", arr[i][j]);
- if (j == ny-1) { // nx?
- printf("\n");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement