10. What does the following fragment of C-program print?

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

 (A) GATE2011 (B) E2011 (C) 2011 (D) 011
Answer: - (C)

why is p[3] - p[1] returning 4 ????

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to