Saturday, June 25, 2011

First Program with C sharp

First Program with  C sharp


A C# program is divided into 4 parts:

  1. Namespace declaration:- This specifies the namespaces that we are going to use in the application. E.g. Using System;
  2. Class declaration:- Here we mentioned the starting class for this project or we can say that this is the entry point for our application.
  3. Main method:- The main method is the entry point of this application and here we can specify the form that we need to open first from this application Application .Run( new Form1 ()); // This line indicates that the control is passed to the instance of Form1() in the application once we start with the application.
  4. Comments:- The comments are given by // and /* */ block in the C# programs. 
 This is a simple C# program.
Call this program Example.cs.

using System; 
 
class MainClass 
   
  public static void Main() { 
    Console.WriteLine("Welcome to www.23plus81tools.blogspot.com")
  
}

If U LIKE THE POST FOLLOW THE BLOG

No comments:

Post a Comment