/*PROGRAM TO PASS WHOLE 2-D ARRAY TO A FUNCTION*/

 

#include<stdio.h>

#include<conio.h>

void fun(int[][],int,int);

void main()

{

int a[2][3]={1,2,3,4,5,6},i,j;

clrscr();

fun(a,2,3);

printf(“\n\n\n”);

for(i=0;i<2;i++)

{

for(j=0;j<3;j++)

{

printf(” \n NEW ARRAY\t a%d%d=%d”,i,j,a[i][j]);

}

}

getch();

}

 

void fun(int x[][3],int m,int n)

{

int i,j;

for(i=0;i<m;i++)

{

for(j=0;j<n;j++)

{

printf(“\ta%d%d=%d”,i,j,x[i][j]);

x[i][j]+=x[i][j];

}

}

}

214 total views, 3 views today

Get Free Email Updates..!
Join us for FREE to get instant email updates..! GobsInfo- Everything Unlimited
We hate spam. Your email address will not be sold or shared with anyone else.