in Programming in C
1,124 views
0 votes
0 votes
#include<stdio.h>

int main()
{
    printf("%c\n", 7["IndiaBIX"]);
    return 0;
}

Please explain how the output is X ? I know while counting in Array will make X . But how this CODE works.........>>?
in Programming in C
by
1.1k views

2 Answers

3 votes
3 votes
Best answer

working like

char a[]="IndiaBIX";
    printf("%c\n", 7[a]);

here 7[a]=a[7]

selected by
1 vote
1 vote
Well in C, a[i] always gets translated to *(a + i)

so *(a + i) = *(i+ a)

     a[i] = i[a]

hope you get it  :)

Related questions