sorry

im really but i changed my program and i got closer to finishing my goal (printing out the numbers larger then their neighbors and their location) However, is printing out number but not the numbers i want. please help.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#include <stdio.h>
#include "genlib.h"

#define size 3

void displaymatrix(int ne[size][size]);
int main()
{   
    int ne[size][size];
    displaymatrix(ne);
    return 0;
}
void displaymatrix(int ne[size][size])
{
     int i, j, m, n;
     
     for (i=0; i<size; i++)
     {
         for (j=0; j<size; j++)
         {
             ne[i][j]=i-j+3;
         }
     }
      for (i=0; i<size; i++)
     {
         for (j=1; j<size; j++)
         {
     for(m=0; m<size; m++)
     {
         for (n=0; n<size; n++)
         {
            if (ne[m][n] > ne[i][j] && ne[m][n] > ne[i-1][j+1])
            {
                  printf("%d in location (%d, %d)\n", ne[m][n], m, n);
            }
         }
     
     }
     } 
     }             
     getchar();
     }
please help
is this related to some other thread?
if so, you could post the link ( or even better, post in that thread )
if not, explain your goal in greater detail.
This is your third post on the same problem in this forum. Please don't spam multiple posts on the same problem.
sorry about that. and i fixed the program. but thanks anyways. :D
Topic archived. No new replies allowed.