C Under Linux

To run a c program in linux follow these steps
1. Open the terminal by clicking Ctrl+Alt+T

2. Now, write gcc-v or gcc --version. If it gives you the version then gcc is installed. Otherwise write sudo apt-get install gcc to install gcc


3. Now gcc will be installed. Now to write a simple program open the terminal again

4. Write cd Desktop/ in the terminal.(cd is used to change the directory. Now we are in desktop directory.)

5. Write touch hello.c in the terminal and you will see that the file will be created in the desktop.


6. Now write your c program in hello.c and save the changes.Don,t close the terminal.


7. now write gcc hello.c -o test in the terminal and you will see that a file name test will be installed. Instead of test you can choose any file name.


8. Run the file test by typing ./test in the terminal . You will see your output in the terminal.


Comments

Popular posts from this blog

Installing Linux By Removing Windows

Fixing The Ubuntu Freeze

Dual Booting Linux And Windows