What is the output printed by the following C code? C # include <stdio.h> int…

GATE · 2008 · IT

What is the output printed by the following C code?

C

# include <stdio.h>
int main ()
{
    char a [6] = "world";
    int i, j;
    for (i = 0, j = 5; i < j; a [i++] = a [j--]);
    printf ("%s\n", a);
}

  1. A.

    dlrow

  2. B.

    Null String

  3. C.

    dlrld

  4. D.

    worow

Attempted by 189 students.

Sign up free to check your answer

Sign up free

Explore the full course: Gate Guidance By Sanchit Sir

Loading lesson…