How to Run C# Program in Command Prompt Windows 10:
- Create a text file which has the code you want to run.
- Rename the file to .cs .(Ex: if you have the file name as example.txt, rename it as example.cs)
- The next step is to hit the windows button and directly type "Developer Command Prompt". There will be a command prompt name Developer Command Prompt for VS 2***. ( * represents the year or the version)
- Now the next step is to navigate the command prompt to where your file is stored.
- After navigating the command prompt to the directory type command "csc example.cs" and hit enter. This will create a .exe file in the same directory.
- Now type "example" and hit enter. You can see the output of your file in command prompt