Computer Science, asked by sofiey, 4 hours ago

write a C program to write your name and address in separate lines
hey please help me☹️ it's very critical too me please yaar,bro someone​

Answers

Answered by anindyaadhikari13
2

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

The given program is written in C.

#include <stdio.h>

int main() {

   printf("My Name is - <Write Name Here>\n");

   printf("My Address is <Write your address>");

   return 0;

}

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

  • Here, we have to write name and address on a separate lines. To do that, we have to use escape sequence -\n. It adds a new line. Hence, the problem is solved.

See the attachment for output.

Attachments:
Answered by jahra805
1

Answer:

#include <stdio.h>

int main()

{

  char name[20];

  char address[100];

  //taking input from user

  printf("\n enter your name:\n");

  scanf("%s",name);

   printf("\n enter your address:\n");

  scanf("%s",address);

  //displaying the input

  printf(" Your name is: %s",name);

   printf(" Your Address is: %s",address);

 

}

Explanation:

In this program it takes input from the user and displays the result

Similar questions