You are on page 1of 2

#include<iostream.

h>
#include<conio.h>
void display(int a[4][4],int r,int c)
{ cout<<"enter one value"<<endl;
cin>>c;
cout<<"enter second value"<<endl;
cin>>r;

for(int i=0;i<r;i++)
{
for(int j=0;j<c;j++)
cin>>a[i][j];

for (i=0;i<c;i++)
{
cout<<endl;
for(int j=0;j<r;j++)
{
cout<<a[i][j]<<" ";

}
}
}
void main()
{
clrscr();

int a[4][4];
display(a,4,4);

getch();
}

#include<iostream.h>
#include<conio.h>
void display(int a[4][4],int r,int c)
{
cout<<"enter no. of rows"<<endl;
cin>>r;
cout<<"entr no. of columns"<<endl;
cin>>c;
clrscr();
cout<<"enter the array"<<endl;
for(int i=0;i<r;i++)
{
for(int j=0;j<c;j++)
cin>>a[i][j];
}
for(i=0;i<r;i++)
{
cout<<endl;
for(int j=0;j<c;j++)
cout<<a[i][j]<<" ";
}

}
void main()
{
clrscr();

int a[4][4];
display(a,4,4);
getch();
}

You might also like