Open VS-2022 -> Create New Project -> Search Console App -> Select -> Next.
Enter
Project Name and path -> Click Next
Keep
framework as it is: - Click Create
In
Program.cs file – You don’t have any default class program. Delete all lines
and add below lines:
Program:
using System;
using
System.Collections.Generic;
using System.Linq;
using System.Text;
using
System.Threading.Tasks;
namespace Code_Test
{
class Program
{
static void Main(string[] args)
{
string message = "Hello World!!";
Console.WriteLine(message);
}
}
}
Run the program using F5 or using below option.
Output:
Same way you
can write your business logic Inside main function.
Happy Coding!
Thanks 😊
0 Comments
If you have any queries, please let me know. Thanks.