Printing the characters obtained from the array s using printf?

47 Views Asked by At

Explain the below problem:

main() {
  static char s[25]="vector"; int i=0;
  char ch;
  ch=s[++i];
  printf("%c", ch);
  ch=s[i++];
  printf("%c", ch);
  ch=i++[s];
  printf("%c", ch);
  ch=++i[s];
  printf("%c", ch);
}

OUTPUT :: eecu

I'm trying to figure out how the word 'eec' came to be, but I'm having some trouble. Would you mind sharing your thoughts on this with me?

0

There are 0 best solutions below