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.
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.
Comments
Post a Comment