google-site-verification=HOhRyoPfRGrM6yM8a_npd9STHu3jayDvIKiBvJNraqM
Object-oriented concepts form the base of all modern
programming languages.
This course provides a strong foundation in object-oriented
programming approaches and the fundamentals of C#.
C# is known as C Sharp.
C# is an object-oriented programming language introduced by
Microsoft.
C# is specially designed to work with Microsoft’s .NET
platform.
Before
staring complete C# tutorial, you must know the following guideline. It will
help you to write and execute your c# program easily and hassle free.
We assume, you are using Visual Studio.
Ø Must check proper opening
and closing of curly braces ({}).
Ø Your program should be
properly nested.
Ø Press F5 to execute your
program
Ø if you get exception, press
Ctrl+F5 to stop execution.
Ø If you encounters infinite
loop press Shift+F5 to break execution.
Ø After completion of each
segment, must do exercise. It will help you clear your concept and improve your
programming skills.
Ø Press F11 continuously to
see how your program executes.
How to Write debug
and execute C# program?
Step 1: Open
Notepad and write the following c# code carefully.
using System;
namespace demo
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("welcome to examples guru blog");
}
}
}
Step 2: Now
save this program as Demo.cs. You must choose All Files in save as type box.
Step 3: Go
to Start >Search> Type Command Prompt vs2012> open it as administrator.
![*](file:///C:\Users\Admin\AppData\Local\Temp\msohtmlclip1\01\clip_image001.png)
D:/Csharp> cd foldername
Step 5: Now
compile your program by following command:
csc Demo.cs
You will see some information like compiler version number and framework information. There is no error, so you won’t get any error.
Step 6: Now, its turn to C sharp program. Just write your file name without extension and hit enter.
Demo
Step 7: You will get the welcome to examples guru blog as output.
Using
Visual Studio 2005 or 2008
Visual Studio is easiest way to handle C# code. To
execute the program on visual studio, go through the following steps:
Step 1: Launch Visual Studio and go to File > New Project
Step 2: Select Visual C# in left pane and then choose Console Application.
Step 3: Select your location where you want to save the file and then click OK.
Step 4: Visual Studio will open a code editor window including some necessary code.
Step 5: Now write the above mentioned code and press Ctrl+F5 to run C# code.
Step 6: You will see the same output in Visual Studio Command Prompt.
No comments:
Post a Comment