How to compile C Programm.

How To Compile And Run C Programm From Command Line.


open a text editor which you are using.

now save the file naming it by the extension of C.

Example:- main.c





now open cmd.


now make sure you're in the same directory.

let type the command for compile the C.

gcc -0 "name-of-file" name-of-file.exe

 

In your case gcc -o "main" main.c

and now type "name-of-file"

In your case it is main.








Post a Comment (0)
Previous Post Next Post