C | String | Question 7

In below program, what would you put in place of “?” to print “Quiz”?

filter_none

edit
close

play_arrow

link
brightness_4
code

#include <stdio.h>
int main() 
  char arr[] = "GeeksQuiz"
  printf("%s", ?); 
  return 0; 
}

chevron_right


(A) arr
(B) (arr+5)
(C) (arr+4)
(D) Not possible


Answer: (B)

Explanation: Since %s is used, the printf statement will print everything starting from arr+5 until it finds ‘\0’

Quiz of this Question



My Personal Notes arrow_drop_up


Article Tags :
Practice Tags :


Be the First to upvote.


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