#include <conio.h>
#include <iostream.h>
#include <malloc.h>
int main()
{
int **p;
int i;
int j;
int col = 2;
int row = 2;
p= (int **) malloc (row *sizeof (int*))
for (i = 0; i<row; i++)
{
p[i] = (int *) malloc (col*sizeof (int))
}
for (i=0; i<row; i++)
{
for (j=0; j<col; j++)
{
cout<<"masukkan nilai"<<" ";
cin>>p[i][j];
}
}
for (i=0; i<row; i++)
{
for (j=0; j<col; j++)
{
cout<<p[i][j]<<" ";
}
cout<<endl;
}
getch();
}
No comments:
Post a Comment