Objective
- How to compile and run c# code in notepad as well as visual studio?
- How to run C# code in notepad as well as visual studio?
It has been seemed with various beginners that they are able to understand C# concept but they got failed while implementing their logic into program. The best way to get rid of this types of problem is practice. So, just understand the program that is mentioned below and try to run C# code on your system.
Using Notepad
Step 1: Open Notepad and write the following c# code carefully
Step 2: Now save this program as firstprogram.cs in csharp Folder in D drive (Create csharp Folder in D Drive). You must choose All Files in save as type box.
Step 3: Go to Start > All Programs > Microsoft Visual Studio 2005 or 2008 > Visual Studio Tools > Visual Studio 2005 or 2008 Command Prompt.
- Type D: and hit Enter
- Now type cd csharp and hit Enter
- You are in Csharp Folder now
Step 5: Now compile your program by following command:
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, it’s turn to C sharp program. Just write your file name without extension and hit enter.
Step 7:
You will get the This is my First C# Program as output.
Comments
Post a Comment