Step 1: Check gcc Version
ubuntu@ubuntu-machine:~$ gcc --version
gcc (Ubuntu/Linaro 4.6.1-9ubuntu3) 4.6.1
Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Step 2: Open Text Editor
- Open gedit with GUI (or) ubuntu@ubuntu-machine:gedit
- In Terminal Type gedit and enter.(Note : Now you get gedit editor)
Step 3: Simple C Program
- Now You type these Program and Save Desktop, file named as example.c
#include <stdio.h>
int main(void)
{
printf("This website Name is www.thiyagaraaj.com\n");
return 0;
}
Step 4: Check C File
- Open New Terminal and Type ls
ubuntu@ubuntu-machine:~$ ls
Desktop glassfish-3.1.1 NetBeansProjects tmp
Documents Image Pictures
Downloads Music Public
- Now Move Desktop with these command
ubuntu@ubuntu-machine:~$ cd Desktop
Check C File
ubuntu@ubuntu-machine:~/Desktop$ ls
example.c
Step 5: Compile C Compiler
- Complie C Program with gcc compiler
ubuntu@ubuntu-machine:~/Desktop$ gcc example.c
Step 6: Check Execute File
ubuntu@ubuntu-machine:~/Desktop$ ls
a.out example.c example.c~
- Here a.out is execution format of the example.c file
- Now Execute a.out
ubuntu@ubuntu-machine:~/Desktop$ ./a.out
Sample Output:
This website Name is www.thiyagaraaj.com