C Programming - Strings - Discussion

Discussion Forum : Strings - Find Output of Program (Q.No. 13)
13.
What will be the output of the program ?
#include<stdio.h>

int main()
{
    static char s[25] = "The cocaine man";
    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);
    return 0;
}
hhe!
he c
The c
Hhec
Answer: Option
Explanation:
No answer description is available. Let's discuss.
Discussion:
34 comments Page 4 of 4.

Koteswararao said:   8 years ago
Nice explanation. Thank you all.

Xyz said:   1 decade ago
Can anyone explain clearly.

Darshan said:   9 years ago
Nice explanation @ Ragini.

Jhon said:   9 years ago
Why s[i]=i[s]?


Post your comments here:

Your comments will be displayed after verification.