Frequent Question: How Do I Run Gcc on Ubuntu?
Contents How Do I Run a Gcc Program in Ubuntu? to Open the Terminal, You Can Use the Ubuntu Dash or the Ctrl+Alt+T Shortcut. Step 1: Install the...
Contents
How do I run a gcc program in Ubuntu?
To open the Terminal, you can use the Ubuntu Dash or the Ctrl+Alt+T shortcut.
- Step 1: Install the build-essential packages. …
- Step 2: Write a simple C program. …
- Step 3: Compile the C program with gcc Compiler. …
- Step 4: Run the program.
How do I run a gcc file in Terminal?
Answer
- Write your code in your favorite editor: In the terminal, type nano yourcode. …
- Back to the terminal, navigate to where your C file is stored. (Reminder: ls to list directory contents, cd to change directory.)
- Compile your code with gcc -o program yourcode. c .
- Execute it with ./program . Done!