#include<stdio.h> main() { int i[3][3]= { {1,2,3}, {3,4,5}, {5,6,7} }; int *p,*q,*r,k; printf("Adding 2 to all elements of the array.\nArray Becomes:\n"); p=&i; for(k=0;k<9;k++) { printf("%d\n",*(p+k)+2); } }
Output [Click to enlarge]:
All in one blogging website