~/MyDocs/files $ vi hellowrold.c //create a c program by using vi editor
Note : for entering any letter you should press “I” to enter in to insert mode#inlcude <stdio.h> main() { Printf(“M. Reddi Prasad Reddy,IP University,Delhi”); }Note: to save the files click ESC and shift+: and wq! .so that your c program will be saved.
#inlcude <stdio.h> main() { Printf(“M. Reddi Prasad Reddy,IP University,Delhi”); }
~/MyDocs/files $ gcc-4.2 hello.c // gcc compiler will compile your c program ~/MyDocs/files $ ls // you will find the output file a.out hello.c
~/MyDocs/files $ sudo gainroot //shell root will be enabled ~home/usr/MyDocs/files # cp a.out /usr/bin // to see the output you should copy this outputfile to bin folder ~/usr/bin # chmod +x a.out // change the permissions ~/usr/bin # ./a.out