Skip to content
Related Articles

Related Articles

C | String | Question 13
  • Difficulty Level : Basic
  • Last Updated : 09 Sep, 2013




int main()
{
    char p[] = "geeksquiz";
    char t;
    int i, j;
    for(i=0,j=strlen(p); i<j; i++)
    {
        t = p[i];
        p[i] = p[j-i];
        p[j-i] = t;
    }
    printf("%s", p);
    return 0;
}

Output?
(A) ziuqskeeg
(B) Nothing is printed on the screen
(C) geeksquiz

(D) gggggggg


Answer: (B)

Explanation: The string termination character ‘\0’ is assigned to first element of array p[]

Quiz of this Question

Want to learn from the best curated videos and practice problems, check out the C Foundation Course for Basic to Advanced C.
My Personal Notes arrow_drop_up
Recommended Articles
Page :