Top

Discussion

What is the output of this C code?

int main()
{
printf("C programming %s", "Class by\n%s AllIndiaExams", "SUPER");
}

 

  • A.C programming Class by SUPER AllIndiaExams
  • B.C programming Class by\n%s AllIndiaExams
  • C.C programming Class by %s AllIndiaExams
  • D.Compilation error

Answer: C

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

No comment is present. Be the first to comment.
Loading…

Post your comment