[ create a new paste ] login | about

Link: http://codepad.org/Ht9r6QwN    [ raw code | output | fork ]

appunti2 - C, pasted on Apr 30:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include <stdio.h>

int main (int argc, char *argv[])
{
  int a[3][4] = {{1,  2,  3,  4},
                 {5,  6,  7,  8},
                 {9, 10, 11, 12}};
  int i, j;

  for (i = 0; i < 3; i++)
    {
      for (j = 0; j < 4; j++)
        {
          printf ("a[%i][%i]=%i\t", i, j, a[i][j]);
        }
      printf ("\n");
    }

  return 0;
}


Output:
1
2
3
a[0][0]=1	a[0][1]=2	a[0][2]=3	a[0][3]=4	
a[1][0]=5	a[1][1]=6	a[1][2]=7	a[1][3]=8	
a[2][0]=9	a[2][1]=10	a[2][2]=11	a[2][3]=12	


Create a new paste based on this one


Comments: