Step 1: open the visual studio command prompt (start => Microsoft visual studio=> visual studio tools =>visual studio command prompt).

Step 2: Type “notepad Filename.cs”.

Step 3: Once u finish the c# program save the file.

Step 4: use csc command to execute
Syntax : csc Filename.cs

Step 5: Enter the exe file name ( once u successfully execute the program. It automatically generate the exe file with the same file name. so type the same file name without extension)
Difference between Java and c#
In java javac filename.java comment create the class file with the class name. Then we can execute the java program by entering java classname.
Where as in c# csc command will create the exe file with the same name. By entering the filename alone we can run the program.
No comments:
Post a Comment