Home » C Programming » Constants » Question
  1. What will be the output of the following C code?
     #include <stdio.h>
    int main()
    {
    printf("C programming %s", "Class by\n%sInterview Mania", "Woowoo");
    }
    1. C programming
    2. C programming Class by Interview Mania Woowoo
    3. Compilation Error
    4. C programming Class by
      %sInterview Mania
    5. None of these
Correct Option: D

This program has only one %s within first double quotes, so it does not read the string “WOW”.
The %s along with the Interview Mania is not read as a format modifier while new line character prints the new line.



Your comments will be displayed only after manual approval.