title: Counting Values in a 2D array - C
body: <p>So I've been trying to work my way through an assignment learning C, and was just hoping for some sort of correction for where i'm going wrong</p>
  
  <p>The scenario is a survey, and this is the output i'm expected to produce</p>
  
  <pre><code>     POPULARITY TABLE
       ----------------------------------------------------
       City Cricket Footy Tennis Soccer
       -----------------------------------------------------
       Melbourne 4 1 1 4
       Sydney 4 5 1 0
       Brisbane 2 2 4 4
       Adelaide 1 0 2 0
      ----------------------------------------------------- 
  </code></pre>
  
  <p>Variables being M, S, B, A and 1,2,3,4 for the table</p>
  
  <p>Everytime I execute my code, it either doesn't count the values or it says theres 36 of one value</p>
  
  <pre><code>   #include  &lt;stdio.h&gt;
     int main()
      {
          int  i,  j;
          char M, B, S, A;
          int m_cricket = 0, m_footy = 0, m_tennis = 0, m_soccer = 0;
          int s_cricket = 0, s_footy = 0, s_tennis = 0, s_soccer = 0
          int b_cricket = 0, b_footy = 0, b_tennis = 0, b_soccer = 0
          int a_cricket = 0, a_footy = 0, a_tennis = 0, a_soccer = 0
          int survey[36][2] = {{M, 1}, {S, 2}, {B, 1}, {B, 3}, {M, 2}, {B, 4}, {S, 1}, {A, 3}, {M, 4}, {B, 2}, {B, 1}, {S, 3}, {B, 4}, {B, 4}, {M, 1}, {M, 1}, {B, 3}, {B, 3}, {S, 1}, {S, 1}, {S, 2}, {M, 4}, {M, 4}, {S, 2}, {A, 1}, {S, 2}, {B, 3}, {M, 1}, {B, 1}, {S, 2}, {A, 3}, {M, 4}, {S, 1}, {B, 2}, {M, 3}, {B, 4}};
  
  for (int i = 0; i &lt; 36; i++)
  {
          for (int j = 0; j == 2; j++)
          {
              if (survey[i][j] == M, 1)
              {
                  m_cricket++;
              }
          }
  
  }
  
      printf("\tCity  Cricket Footy  Tennis  Soccer\n");
      printf("------------------------------------------------\n");
      printf("Melbourne:\t %d\t %d\t %d\t %d\t\n", m_cricket, m_footy, m_tennis, m_soccer);
      printf("Sydney:\t %d\t %d\t %d\t %d\t\n", s_cricket, s_footy, s_tennis, s_soccer);
      printf("Brisbane:\t %d\t %d\t %d\t %d\t\n", b_cricket, b_footy, b_tennis, b_soccer);
      printf("Adelaide:\t %d\t %d\t %d\t %d\t\n", a_cricket, a_footy, a_tennis, a_soccer);
  
      return 0;
  }   
  </code></pre>
  
  <p>Where have I gone wrong? Is there a better way I could code this?</p>
  
  <p>I only coded for Melbourne as when coding this, i was going under the logic that if i could get one city working, the rest would be straightforward</p>