How To Run Program In C ?

Compile and Run C programming on your OS

There are numerous compilers and text editors you can use to run C programming. These compilers and text editors may differ from system to system.
You will find the easiest way to run C programming on your computer (Windows, Mac OS X or Linux) in this section.

Run C Programming in Windows (XP, 7, 8 and 10)

To run C Programming in Windows, download a software called Code::Blocks. Then, write C code, save the file with .c extension and execute the code.

To make this procedure even easier, follow this step by step guide.

1.     Go to the binary release download page of Code:Blocks official site.
                2.Under Windows XP / Vista / 7 / 8.x / 10 section, click the link with mingw-setup(highlighted row) either from Sourceforge.net or ForssHub.

3.    Open the Code::Blocks Setup file and follow the instructions (Next > I agree > Next > Install); you don’t need to change anything. This installs the Code::Blocks with gnu gcc compiler, which is the best compiler to start with for beginners.
                4. Now, open Code::Blocks and go to File > New > Empty file (Shortcut: Ctrl + Shift + N)



                    5.Write the C code and save the file with .c extension. To save the file, go to File > Save (Shortcut: Ctrl + S).
Important: The filename should end with a .c extension, like: hello.c,  your program name is C.




6.     To run the program, go to Build > Build and Run (Shortcut: F9). This will build the executable file and run it.

N.B: If your program doesn’t run and if you see error message "can't find compiler executable in your search path(GNU GCC compiler)", go to Settings > Compiler > Toolchain executables and click Auto-detect. This should solve the issue in most cases.

























*

إرسال تعليق (0)
أحدث أقدم