edited by
980 views

1 Answer

0 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
Position:
Show:

Related questions

1 1 vote
0 0 answers
1.9k
1.9k views
Aibi asked Oct 30, 2017
1,858 views
What is the output of below code considering the size of short int is 2, char is 1 and int is 4 bytes.#include<stdio.h>main(){short int i = 20;char c = 97;printf("%d, %d,...
0 0 votes
1 answers 1 answer
913
913 views
Hemant Parihar asked Feb 3, 2017
913 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 2 votes
2 2 answers
960
960 views
0 0 votes
1 1 answer
1.3k
1.3k views