#include <stdio.h>
#include <conio.h>
void input(int**, int, int);
void show(int**, int, int);
main()
{
int a[3][3];
int row = 3, col = 3;
clrscr();
input(( int** )a, row, col);
show(( int** )a, row, col);
getch();
return 0;
}
void input(int **p, int r, int c)
{
int i, j;
for( i = 0; i < r; i++ )
{
for( j = 0; j < c; j++ )
{
printf(" \n Enter p[%d][%d] element: ", i, j);
scanf(" %d ", *(p + i) + j);
}
}
}
void show(int **p, int r, int c)
{
int i, j;
printf(" \n Matrix is\n ");
for( i = 0; i < r; i++ )
{
for( j = 0; j < c; j++ )
printf(" %d ", *(*(p + i) + j));
printf(" \n ");
}
}
OUTPUT:
Enter p[0][0] element: 4
Enter p[0][1] element: 6
Enter p[0][2] element: 3
Enter p[1][0] element: 2
Enter p[1][1] element: 8
Enter p[1][2] element: 7
Enter p[2][0] element: 5
Enter p[2][1] element: 1
Enter p[2][2] element: 9
Matrix is
4 6 3
2 8 7
5 1 9
ALSO READ:
-- Program To Understand Working Of Address Concept.
-- Program On Use Of Array & Pointer Concept Together.
-- Program On Pointers & 2 - Dimensional Array.
-- Program On Strings Into Array Of Pointers.
-- Program To Accept & Add Ten Numbers Using Pointers.
-- Program To Implement Minimum Spanning Tree Using Functions, Pointers & Structures.
-- Program To Implement 8 Queens Problem Using Arrays, Pointers & Functions.
-- Program To Implement Quick Sort Using Pointers, Functions & Arrays.
-- Program With Algorithm To Implement Bubble Sort Using Pointers.
-- Program To Implement Recursive Algorithm Using Pointers.
-- Program On Strings Into Array Of Pointers.
-- Program On Pointers & 2 - Dimensional Array.
-- Program On Use Of Array & Pointer Concept Together.
-- Program On Arithmetic Calculations Using Pointers.
-- Program To Add Two Numbers Using Pointers.
-- Program To Accept & Add Ten Numbers Using Pointers.
... Back To C Program Index.
Comments
Post a Comment
Please share your opinions and suggestions or your experience in the comments section. This way we can all help each other...
Experienced guys can share their resumes at admin@interview-made-easy.com