edited by
479 views

1 Answer

0 votes
0 votes
output is 30

 

*(p+20*j+i)=i*30+j;

for i=0, j=0 , *(p+0)=0 -> a[0][0]

for i=0, j=1, *(p+20)=1 -> a[0][20]

for i=0, j=2, *(p+40) = 2 ->a[1][10]

so, a[6][10]=*( p+6*20+10)  so i = 10, j= 6, so value= 10*30 + 6

a[6][9]=*( p+6*20+9)  so i = 9, j= 6, so value= 9*30 + 6

    printf("%d",a[6][10]-a[6][9]);

a[6][10]= 306

a[6][9]=276

difference 30
edited by

Related questions

1 votes
1 votes
0 answers
1
0 votes
0 votes
1 answer
2
Hemant Parihar asked Feb 3, 2017
538 views
#include<stdio.h>int main() { char *p; p = "%d\n"; p++; p++; printf(p-2, 400); return 0;}Output : 400I ran this program and got 400 as output. But I don...
2 votes
2 votes
2 answers
3