Difference between .com program and .exe program in c programming language

Both .com and .exe program are executable program but .com program execute faster than .exe program. All drivers are .com program. .com file has higher preference than .exe 
For example:
Open the command prompt in window OS. (Type CMD in Run)
In the command prompt type notepad and press enter key you will get the notepad. Since it executes notepad.exe 

Repeat the same task but now first create any .com file in the same working directory. We can create it as open the notepad save it as notepad.com, set save as type is All files or we can create the .com file from command prompt.

Then type notepad in command prompt and press the enter key you will get error message like:   
C:\notepad.com is not a valid Win32 application.

It proves that .com has higher precedence than .exe program.

Com file is binary execute used in MS DOS. Com program keeps only code and data. It stores code and data in one segment. In Turbo C memory model should tiny to create .com program. We will discuss later how to create .com file in in turbo c.

C tutorial home.


சதீஷ் குமார் said...


Please tell me, How to write .com files

Anonymous said...

Add some more details......

sumitha said...

i want more detail ..

sunayana said...

plz explain it more clearly

Mudit Verma said...

it's nice one.

pratyusha said...

how can select insert and delete function in c

Anonymous said...

select tiny model in compiler for .com files