How To Run And Execute C# Program Using Notepad

Introduction

In this article, you will learn how to run C# programs using notepad and Visual Studio command properties. it should be - Open the Notepad, write the program, and after that run the command prompt.

Requirements

  • Notepad
  • Visual Studio 2012 ARM phone tool command prompt
  • C#.

Step 1. Open the new notepad with shortcut keys Ctrl+N.

  Open the new notepad  that shortcut keys Ctrl+N

Step 2. Here, we should write the C# code or program.

program

program

using System;  
using System.Collections.Generic;  
using System.Linq;  
using System.Text;  
using System.Threading.Tasks;  
namespace ConsoleApplication8 {  
    class TextWord {  
        public void print() {  
            Console.WriteLine("hai welcome to our c# program");  
            Console.ReadLine();  
        }  
    }  
    class Arithmetic: TextWord {  
        public void sum() {  
            int a = 10;  
            int b = 20;  
            int c = a + b;  
            int d = a - b;  
            int e = a * b;  
            Console.WriteLine("The Addition value is an:" + c);  
            Console.WriteLine("The Subtraction value is an:" + d);  
            Console.WriteLine("The Multiplication value is an:" + e);  
            Console.ReadLine();  
        }  
    }  
    class example {  
        static void Main(string[] args)  
            . {  
                TextWord obj1 = new TextWord();  
                obj1.print();  
                Arithmetic obj2 = new Arithmetic();  
                obj2.sum();  
            }  
    }  
}

Step 3. We can save the program at a particular file location with  shortcut Ctrl+S.

particular

particular

Step 4. Now, go to Visual Studio 2012 ARM Phone Tool Command Prompt and open the window.

particular

Step 5. Here, type your program location colon.

particular

Step 6. The next step is to go to the particular folder because program is stored in that folder.

particular

Step 7. Now, compile the C# program with this command.

particular

particular

Step 8. Now, execute the current program.

program

Step 9. Now, we can see the output.

output


Similar Articles