Skip to content
Utopper skill
  • ProgrammingExpand
    • Programming Examples
  • Interview QuestionsExpand
    • DevOps Interview Questions
    • Android Interview Questions
  • How to
  • Tools
  • Top 10
  • Book Summaries
Utopper skill
Programming Examples C Programming Example

C Program to Print Your Own Name with Example

Article Contents

  1. C Program to Print Your Own Name
    1. Approach 1 :
    2. Approach 2 :
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
Post Tags: #c program#C Program Examples
Avatar photo
Utopper Skill Team
Facebook X Instagram YouTube Linkedin Pinterest

Post navigation

Previous Previous
Book Summary of Why We Sleep By Matthew Walker
NextContinue
C++ Program To Print Prime Numbers From 1 To N

Latest Interview Questions

  • C++ Program To Print Prime Numbers From 1 To N
  • C Program to Print Your Own Name with Example
  • Book Summary of Why We Sleep By Matthew Walker
  • Book Summary of Indistractable By Nir Eyal
  • C Program To Convert Fahrenheit To Celsius
  • Book Summary of The One Thing By Gary Keller and Jay Papasan
  • Facebook
  • Instagram
  • YouTube
  • Telegram
  • LinkedIn
  • Twitter

Mail : [email protected]

Privacy Policy | DISCLAIMER | Contact Us

Learn Development

learn HTML

learn CSS

learn JavaScript

Examples

C Examples

C++ Examples

Java Examples

Study Material

Interview Questions

How to

Hosting

SEO

Blogging

© 2023 Utopper.com

All Rights Reserved with Copyright & Registered TradeMarks
OWNED BY : GROWTH EDUCATION SOLUTIONS PRIVATE LIMITED

Scroll to top
  • Programming
    • Programming Examples
  • Interview Questions
    • DevOps Interview Questions
    • Android Interview Questions
  • How to
  • Tools
  • Top 10
  • Book Summaries
Search