Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 22 additions & 4 deletions Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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)