Computer Science, asked by parthana08, 4 months ago

Write a C program to display the following output a single printf()

I

Love

Computer

Science​

Answers

Answered by anindyaadhikari13
2

\texttt{\textsf{\large{\underline{Solution}:}}}

The given co‎de is written in C.

#include <stdio.h>

int main() {

   printf("I\nLove\nComputer\nScience");

   return 0;

}

\texttt{\textsf{\large{\underline{Explanation}:}}}

  • Here, we have to display the given text using single printf() statement.
  • So, to solve this question, we have to use escape sequence.
  • '\n' - It creates a new line. So, here we can use this to achieve the result.

See the attachment for output.

Attachments:
Similar questions