Utopper SkillUtopper Skill
  • Programming
    • Programming Examples
  • Interview Questions
    • DevOps Interview Questions
    • Android Interview Questions
  • How to
  • Tools
  • Top 10
  • Book Summaries
Reading: C Program to Print Your Own Name with Example
Share
Utopper SkillUtopper Skill
Search
  • Book Summaries
  • Programming Examples
  • C Programming Example
  • Interview Question
  • How to
  • Top 10
Follow US
Utopper Skill > Programming Examples > C Programming Example > C Program to Print Your Own Name with Example
Programming ExamplesC Programming Example

C Program to Print Your Own Name with Example

Utopper Skill Team
By Utopper Skill Team Last updated: December 15, 2023
Share
2 Min Read
C Program to Print Your Own Name
SHARE
C Program to Print Your Own Name

In this article, We are sharing C Program to Print Your Own Name and we are giving 2 Approaches to do this Task. If you Like the Article , Do share it with the People.

C Program to Print Your Own Name

Approach 1 :

#include <stdio.h>
int main() {
  printf("My name is [insert your name here]!\\n");
  return 0;
}

Replace [insert your name here] with your actual name, and then compile and run the program. The output should be:

My name is [your name]!

Approach 2 :

#include <stdio.h>
int main() {
  char name[50];
  printf("Please enter your name: ");
  scanf("%s", name);
  printf("Your name is %s!\\n", name);
  return 0;
}

In this program, we first declare a character array name with a size of 50. Then we use printf to prompt the user to enter their name. After that, we use scanf to read in the user’s input and store it in the name array. Finally, we use printf again to print out the user’s name.

When you run the program, you should see something like this:

Please enter your name: [type your name here]
Your name is [your name]!

Other C programming examples you can Read:

  • Palindrome Number
  • Fibonacci Series in C
  • Prime Number in C
  • Even or Odd Number in C
TAGGED:c programC Program Examples
Share This Article
Facebook Twitter Whatsapp Whatsapp Telegram Copy Link Print
Previous Article Book Summary of Why We Sleep By Matthew Walker Book Summary of Why We Sleep By Matthew Walker
Next Article C++ Program To Print Prime Numbers From 1 To N C++ Program To Print Prime Numbers From 1 To N
Most Popular
Learn C Programming (Basic to Advanced)
One Dimensional Array in C
Utopper Skill Author By Utopper Skill Author
Learn C Programming (Basic to Advanced)
C Environmental Setup
Utopper Skill Author By Utopper Skill Author
Learn C Programming (Basic to Advanced)
#include in C with Example
Utopper Skill Author By Utopper Skill Author
Book Summary of Why Nobody Told Me This Before By Dr. Julie Smith
Book Summary of Why Nobody Told Me This Before? By Dr. Julie Smith
Utopper Skill Author By Utopper Skill Author
Android Interview Questions and Answers
Top 40 Android Interview Questions and Answers for 2024
Utopper Skill Team By Utopper Skill Team

You Might Also Like

C++ Program To Print Prime Numbers From 1 To N
C Programming ExampleProgramming Examples

C++ Program To Print Prime Numbers From 1 To N

11 Min Read
C Program To Convert Fahrenheit To Celsius
C Programming ExampleProgramming Examples

C Program To Convert Fahrenheit To Celsius

5 Min Read
C Program To Find LCM of Two Numbers
Programming ExamplesC Programming Example

C Program To Find LCM of Two Numbers

6 Min Read
C++ Program To Add Two Complex Numbers
Programming ExamplesC++ Programming Example

C++ Program To Add Two Complex Numbers

8 Min Read

Mail : [email protected]

Privacy Policy | DISCLAIMER | Contact Us

Learn

  • learn HTML
  • learn CSS
  • learn JavaScript

Examples

  • C Examples
  • C++ Examples
  • Java Examples

Study Material

  • Interview Questions
  • How to
  • Hosting
  • SEO
  • Blogging

 

© 2024 : UTOPPER.COM | Owned By : GROWTH EDUCATION SOLUTIONS PRIVATE LIMITED
Welcome Back!

Sign in to your account

Lost your password?