GATE | GATE CS 2011 | Question 22

What does the following fragment of C-program print?

filter_none

edit
close

play_arrow

link
brightness_4
code

char c[] = "GATE2011";
char *p =c;
printf("%s", p + p[3] - p[1]) ;

chevron_right


(A) GATE2011
(B) E2011
(C) 2011
(D) 011


Answer: (C)

Explanation: See https://www.geeksforgeeks.org/c-language-set-8/

Quiz of this Question



My Personal Notes arrow_drop_up


Article Tags :

Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.