Skip to content
Related Articles

Related Articles

Improve Article

C | String | Question 13

  • Difficulty Level : Easy
  • Last Updated : 28 Jun, 2021


Take a step-up from those "Hello World" programs. Learn to implement data structures like Heap, Stacks, Linked List and many more! Check out our Data Structures in C course to start learning today.



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

My Personal Notes arrow_drop_up
Recommended Articles
Page :