diff --git a/Program.cs b/Program.cs index fd851a1..60c0e2c 100644 --- a/Program.cs +++ b/Program.cs @@ -4,10 +4,28 @@ class Program { static void Main() { - Console.WriteLine("Hello World!"); - // See https://aka.ms/new-console-template for more information - Console.WriteLine("Hello, World!"); + // Output to console basic text + // Console.WriteLine(TextHello()); + + // Output get datetime to console + // Console.WriteLine(GetDateSystem()); + + // Input from user + Console.WriteLine(InputFromUser()); + } + + static String TextHello() { + return "Hello World!"; + } + + static String GetDateSystem() { + DateTime getDateBySystem = DateTime.Now; + return "Date now: " + getDateBySystem; + } + + static String InputFromUser() { + Console.Write("Type your name: "); var name = Console.ReadLine(); - Console.WriteLine("Date now: " + DateTime.Now); + return "Hi, " + name; } } \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..7802eac --- /dev/null +++ b/README.md @@ -0,0 +1,22 @@ +## Project Base Learn .NET Console +Project console .NET basic from 0 to hero + +## a. Get Date by System + +```.cs +DateTime getDateBySystem = DateTime.Now; +return "Date now: " + getDateBySystem; +``` + +![Screenshot 2025-02-10 at 17 07 25](https://github.com/user-attachments/assets/65df1e27-62a9-4155-956c-a19cb11d0d34) + + +## b. Type Input & Show to Output + +```.cs +Console.Write("Type your name: "); +var name = Console.ReadLine(); +return "Hi, " + name; +``` + +![Screenshot 2025-02-10 at 17 09 49](https://github.com/user-attachments/assets/a9547da4-d992-42e3-b506-32c4892fd365)