1. using System;
  2. class Program
  3. {
  4. static void Main()
  5. {
  6. Console.WriteLine("Welcome to the Greeting Program!");
  7. Console.Write("Please enter your name: ");
  8. // Read user input
  9. string userName = Console.ReadLine();
  10. // Greet the user
  11. Console.WriteLine($"Hello, {userName}! Welcome to C# programming.");
  12. // Keep the console window open until a key is pressed
  13. Console.WriteLine("\nPress any key to exit...");
  14. Console.ReadKey();
  15. }
  16. }
 
 

96

Pasted Text #34501

The C# code provided is a simple console application that prompts the user for their name, greets them with a personalized message, and waits for any key press before exiting.

PasteBin

Lines
20
Words
56
Size
526 바이트
Created
타입
text/x-csharp
All Rights Reserved ((C))
Please log in to leave a comment!