1,113 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.........>>?

2 Answers

Best answer
3 votes
3 votes

working like

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

here 7[a]=a[7]

selected by

Related questions

0 votes
0 votes
0 answers
1
aimhigh asked Jan 8, 2019
1,233 views
#include<stdio.h>void main(){int p=-8;int i= (p++,++p);printf("%d\n",i);}
0 votes
0 votes
1 answer
2
Desert_Warrior asked May 16, 2016
2,310 views
#include<stdio.h int main() { int a = 5; int b = ++a * a++; printf("%d ",b); return 0; }(a) 25 (b) 30 (c) 36 (d) Undefined Behavior
0 votes
0 votes
2 answers
3
Desert_Warrior asked May 16, 2016
8,787 views
#include<stdio.h int main() { int a = 5; switch(a) { default: a = 4; case 6: a ; case 5: a = a+1; case 1: a = a-1; } printf("%d \n",a); return 0; }(a) 5 (b) 4 (c) 3 (d) N...
0 votes
0 votes
2 answers
4