In this post, I will be showing you guys how to compile and run/execute a C program in your terminal. But before I begin this tutorial, I expect that you would have already installed a Mingw C compiler on your PC otherwise this process will not work.
Steps to run a C program in terminal
- Open the location of your ".c" file.
- Press Shift + Right click which will open a dialog box. From here select "Open Command Window Here" or "Open Powershell Window Here". It will then open the terminal
- Type "gcc {name of file with extension}" and press enter. It will compile your code and create an executable file that you'll use to run your program
- Now type "a.exe" and it will run your program
That's it. You have successfully executed your C program in terminal. If you faced any issue, make sure you've followed all they steps correctly and ensure there's no error in your code.
Please share this article with your friends. Thank you very much!
Awesome Aariz - Read Articles on Computer and Internet

Post a Comment
Please do not spam!