GATE | CS | 2015 | Set 3 | C Programming | Pointers | Question 7

Last Updated :
Discuss
Comments

Consider the following C program segment. 
 

C
# include <stdio.h>
int main( )
{
    char s1[7] = "1234", *p;
    p = s1 + 2;
    *p = '0' ;
    printf ("%s", s1);
}

What will be printed by the program?
 

12 

120400

1204

1034

Share your thoughts in the comments