How Can I Run A C,C++ & JAVA Program From The Command Prompt?

1

1 Answers

Virgo Nadia Profile
Virgo Nadia answered
The C Program manages a class with a Main method controlling. If you want to run the C program on your computer the first of all install a MS.NET framework then compile this program on command prompt because it is necessary for compile a C program use this command on command prompt : Csc Virgo1.csA successful compilation will create a single output file named Virgo1.exe and after compiling enter the following command at the command prompt to run the program:

Virgo1
Then your program display the output .Like in coding you pass the string "Hello Virgo" ,so when you run this program on command prompt ,this sting display as output like:
Hello Virgo
The C++ Program manages a class with a Main method controlling same as C program. To compile this program normally it uses a tool such as MS Visual Studio. You can execute your program within MS Visual Studio. When you do, the following text will be displayed on the screen of MS Visual Studio:

Hello Virgo
You can also execute your compiled program in the command prompt same as C program.
The Java program also manages the controlling class with a main method. To compile the program on a computer, first of all you must install Java JDK, and then enter the following command at the command prompt:
Javac Virgo1.java
A successful compilation will produce a single output file named Hello1.class .To run the program, enter the following command at the command prompt in the directory containing the class file:
java Virgo1
Then you can see the output same as C and C++ Program on command prompt.
thanked the writer.
Farah Khan
Farah Khan commented
C language don't support classes. Its simply a functional programming. For C++ there are two options either use a class or use C style functional programming.

Answer Question

Anonymous