Character Array MCQ 12 : String

Character Array MCQ 12 : Random Address

What is the Output of the Following Program ?


int main()
char str[] = "Programming";

printf("%s ",&str[2]);
printf("%s ",str);
printf("%s ",&str);


Options :

  1. ogramming Programming Programming
  2. ogramming Programming < Garbage Value >
  3. Programming ogramming Programming
  4. Program Compiled with Syntax Errors


Switch to String MCQ Home : Click Here

  • &str[2]” means Memory Address of str[2]
  • “Address of str[2] acts as “Base Address” and it prints string From str[2] Onwards.
  • While Loading Address “str[0]” or “str” or “&str” contain Same Address.