The steps are given below:
1. Open terminal in Ubuntu(Ctrl+Alt+t).
2. Check for the gcc version available with the help of following command.
$ gcc –version or $ gcc -v
3. Open Text Editor now, where you can write your c program. To open this you can use either GUI or simply type gedit and enter in Terminal.
4. Now in Editor type the simple program, like
printf(“Name of this blog is kaurdavinder.wordpress.com\n”);
* Lets save this file with the name first.c in Documents.
5. Now open terminal and check for a file. Type “ls” which will give you a list of all files available.
*Complete list of all available directories and file is generated. As you have saved our file in Document so open Documents.
6. To open Documents type
$ cd Documents
*Command cd is for change directory.
7. Dirctory is changed now. Check for your file first. Type
8. If there exists your file named first.c, now its time to compile this.
9. To Comile, type-
~/Documents$ gcc first.c
10. Now c program is Compiled.
11. To check Execute File, type-
a.out first.c first.c~
*a.out is execution format of the first.c
12. Now execute a.out by
Name of this blog is kaurdavinder.wordpress.com