Custom Search

Thursday 17 September 2015

C#: How to Print message on console, C Sharp basic Program

Basic Structure of C Sharp
In every programming language their is actually a way to write text on the console window or you can say may be the syntax to write the same.

For example
using System
public static void main()
{
Console.WriteLine("Welcome to C- Prog. Concepts");
}

using System
This line tells us that we are going to use the code which is present insude the system namespace.

Its helps as a building block and combines all the data inside your code as a collection os classes, interface struts, enums etc

If we don't use system namespace the program will not interpret what is actually the console in the below line is.

WriteLine("")
In this the text in double quotes will be displayed in the console and this is what the user will see in the screen. It is similar to printf in C++, echo in unix etc.

No comments:

Post a Comment

Laptops