answersLogoWhite

0

How to excute c program on dos?

Updated: 8/11/2023
User Avatar

Wiki User

12y ago

Best Answer

Command-line and IDE C compilers: There are two types of C compilers, each of which has advantages and disadvantages: (i) Command-line C compilers and (ii) IDE or Windows C compilers To compile and run a C program using a command-line C compiler, you have to go through the following steps: (i) Write the C program (call it ``myfile.c'') in a text editor or word processor (for example, the simple ``Hello'' program below), (ii) Save it as a file on your computer's hard disk, (iii) ``Compile it'' to a computer-executable program by entering a compile command at a command prompt, for example for the following C compiler programs: gcc -Wall -o myfile myfile.c (using the GNU C compiler, UNIX or Microsoft Windows) cl myfile.c (Microsoft Visual C++ command-line compiler) bcc32 myfile.c (Borland C/C++ compiler, Microsoft Windows) followed by the ``Enter'' key, and finally (iv) Run the program by entering myfile at a command prompt, again followed by ``Enter''. If you want to save the output of ``myfile'' as a text file ``myfile.txt'', enter instead myfile > myfile.txt

User Avatar

Wiki User

14y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

13y ago

TCC source.c

or BCC source.c

or something else, depending on your compiler.

This answer is:
User Avatar

User Avatar

Wiki User

13y ago

Compiler-dependent. For TurboC it's TCC source.c

This answer is:
User Avatar

User Avatar

Wiki User

12y ago

If your program is caller foobar.exe, then at command prompt enter "FOOBAR":

C:\> FOOBAR

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How to excute c program on dos?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Can you write program by c language in dos?

Yes.


How c is simple?

any book you read then in the PC excute the prog.then slowly we can handle the c. langague


How do you run c program without ideon dos?

Once the application is compiled, there is no need for an IDE.


How do you run a dos command from a c program?

#include <stdlib.h> int main() { system("dir"); return 0; }


What is a solution for this program cannot run in MS-DOS?

That program might not support MS-DOS..


What has the author Stevens Al written?

Al Stevens has written: 'Teach yourself C plus plus' 'DOS 5.0' -- subject(s): MS-DOS (Computer file) 'C++ games programming' -- subject(s): Computer games, C++ (Computer program language), Programming 'Teach yourself Windows 3.1' -- subject(s): Microsoft Windows (Computer file), Windows (Computer programs) 'Windows 95' -- subject(s): Microsoft Windows (Computer file), Operating systems (Computers) 'Quickc' -- subject(s): C (Computer program language), Compilers (Computer programs), Microsoft QuickC 'Teach yourself ...C [plus] [plus]' 'DOS 6.0' -- subject(s): Accessible book, MS-DOS (Computer file), PC-DOS (Computer file) 'C development tools for the IBM PC' -- subject(s): IBM Personal Computer, Programming, C (Computer program language) 'Wiley's teach yourself C++' -- subject(s): C++ (Computer program language) 'C++' -- subject(s): Accessible book, C++ (Computer program language), C.


How do you get a char from the keyboard in your C program without waiting?

OS-dependent. For DOS use functions kbhit and getch from conio.h


Can you run .exe file in dos operating system?

Yes, if it is a DOS program.


How much memory is found in DOS transient program area?

1. How much memory is found in the DOS transient program area


What is a basic automatic operation of turbo c?

If you are going to program in turbo c (for DOS) you might be better using DJGPP. Google DJGPP for downloading and a whole host of good info.


Why program ends with getch in C?

It's just a nasty trick to prevent the DOS-shell-window from closing when the program terminates. It's strictly for homeworks/school-projects, do not do it in real programs.


When you try to open a dll file it says can't run in dos mode why can't it be run in dos mode and what is dos mode?

It can't be run in DOS mode because it relies on Windows-specific APIs. DOS mode is running the program in either DOS, or in a DOS box under Windows. Basically, it is saying that it can't run on DOS because it is not a DOS program.