Skip to main content
Engineering LibreTexts

3.5: Executing

  • Page ID
    54246
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \) \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)\(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\) \(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\)\(\newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    To execute or run a program on a Windows based machine, type the name of the executable file. For example, to execute or run the hw.exe program:

    C:\fortran> hw
    Hello World.
    C:\fortran>
    

    Which will execute the example program and display the “Hello World.” message to the screen.

    A more complete example is as follows:

    Terminal example.

    It is not necessary to type the extension (i.e., “.exe”) portion of the file name. It should be noted that the space prior to the “H” is not produced by the program, but is how the system displays output.

    To execute or run a program on a Unix or MAC based machine, type “./” and the name of the executable file. For example, to execute or run the hw program:

    c:\fortran> ./hw
    Hello World.
    c:\fortran>
    

    The output ('Hello World.' as displayed on the screen) will be the same for Windows, Unix, or MAC based machines.


    This page titled 3.5: Executing is shared under a CC BY-NC-SA 3.0 license and was authored, remixed, and/or curated by Ed Jorgensen via source content that was edited to the style and standards of the LibreTexts platform; a detailed edit history is available upon request.

    • Was this article helpful?