[ create a new paste ] login | about

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

raja.ashok - C, pasted on Aug 25:
#include <stdio.h>

int main()
{
    int a[10][5];
    int i, j;

    func(10, a);

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

    return 0;
}

void func(int rows, int a[][5])
{
    int i, j;
    for(i = 0; i < rows; i++)
    {
        for (j = 0; j < 5; j++)
        {
             a[i][j] = 1;
        }
    }
}


Output:
1
2
3
4
5
6
7
8
9
10
1	1	1	1	1	
1	1	1	1	1	
1	1	1	1	1	
1	1	1	1	1	
1	1	1	1	1	
1	1	1	1	1	
1	1	1	1	1	
1	1	1	1	1	
1	1	1	1	1	
1	1	1	1	1	


Create a new paste based on this one


Comments: