Syntax and Datatypes
Syntax and Datatypes
Lecture: 03
WELCOME TO
1. Console Application
2. Web Application
3. Android Application
4. Windows Application
Basic Structure and Syntax
namespace FirstConsoleApp
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine(“Hello World”);
}
}
}
Comments
-- Comments can be used to explain C# code, and to make it more readable. It
can also be used to prevent execution when testing alternative code.
Single-line Comments:
Single-line comments start with two forward slashes (//).
Example:
// This is a comment
Console.WriteLine("Hello World!");
C# Multi-line Comments:
-- Multi-line comments start with /* and ends with */.
Thank You