Write a C program to print your name, city and mobile number
Description: Print your name, city and mobile number on separate lines.
Hint:
- Use
printf()and the new line character\n.
C program to print name, city and mobile number
#include <stdio.h>
int main(void) {
printf("Name: Robin Sharma\n");
printf("City: Delhi\n");
printf("Mobile: 9876543210\n");
return 0;
}
Output:
Output of the above program is
Name: Robin Sharma
City: Delhi
Mobile: 9876543210
How it works
- Each
printf()prints one line of text. \nmoves the cursor to the next line.
Read C printf and scanf and Escape Sequences.
Learn more about the similar topics:
| Tutorials |
|---|
| No Content Found. |
| Exercises & Assignments |
|---|
| No Content Found. |
| Interview Questions & Answers |
|---|
| No Content Found. |