1 1 vote main(){ static int n[3][3] = {2,4,3,6,8,5,3,5,1}; Int i,j; for(i=2;i>=0;i--){ for (j=2;j>=0;j--){ printf(“%d ”,*(*(n+i)+j)); } } What will be the output of the program? Programming in C + – mohitbawankar 753 views answer comment Share Follow Print See all 3 Comments 3 3 Comments reply Anu007 commented Jan 2, 2018 reply Follow flag input in reverse order 1 5 3 5 8 6 3 4 2 #include <stdio.h> int main(){ static int n[3][3]={2,4,3,6,8,5,3,5,1}; int i,j; for(i=2;i>=0;i--){ for (j=2;j>=0;j--){ printf( "%d ",*(*(n+i)+j)); } } return 0; } run this here https://www.tutorialspoint.com/compile_c_online.php 0 0 replyShare mohitbawankar commented Jan 2, 2018 reply Follow flag problem is gate not provide any compiler :) 0 0 replyShare Anu007 commented Jan 2, 2018 reply Follow flag ?????? 0 0 replyShare Please log in or register to add a comment.
1 1 vote 2 4 3 6 8 5 3 5 1 1000 1002 1004 1006 1008 1010 1012 1014 1016 *(*(n+i)+j) = here *(n+i) means skipping 'i' rows which contains 3 elements of each size "c" bytes {here, i assumed c=2Bytes} and selecting row which is done by "*". after that, 'j' elements are skipping of size "c" bytes. first iteration: i=2, j=2 *(*(1000+2)+2) = *(*(1000+2*3*2)+2*2) = *(*(1012)+4) =*(1016) = 1 similarly for i=2,j=1 *(*(1000+2)+1) = *(*(1000+2*3*2)+1*2) = *(*(1012)+2) =*(1014) = 5 final o/p: 1 5 3 5 8 6 3 4 2 Akash Mittal answered Jan 2, 2018 Akash Mittal comment Share Follow 0 reply Please log in or register to add a comment.