C | String | Question 13

Last Updated :
Discuss
Comments
C
int main() {
    char p[]="geeksquiz";
    char t;
    int i,j;
    for(i=0,j=strlen(p);i!=j;i++,j--)
    {
        t=p[i];
        p[i]=p[j-i];
        p[j-i]=t;
    }
    printf("%s",p);

    return 0;
}

Output?

ziuqskeeg

Nothing is printed on the screen

geeksquiz

gggggggg

Tags:
Share your thoughts in the comments