Today we will learn how to write your First C Program in Linux, Compiling it with CC, and Running it Linux
Step 1 : Open terminal
Press Ctrl + Alt + T
Step 2 : start vi editor
type this command in terminal
vi
Step 3 : Activate Insert mode
Press Insert key on keyboard or i
Step 4 : Type your program
Step 5 : Now save your program
type Press ESC then : then w
Step 6 : Now type the file name
hello.c press Enter
your program is saved now on disk.
Step 7 : Now exit from vi
press ESC then : then q
Step 8 : Now compile and link your program
type cc hello.c press enter
now you have a file a.out to run, if you want to give different name to output file
type cc -o hello hello.c press enter
Step 9 : Now execute ( run) your program
type ./a.out or ./hello according to the compiler option you used.
now you have done
now you have done
Still confused
Step 1 : Open terminal
Press Ctrl + Alt + T
Step 2 : start vi editor
type this command in terminal
vi
Step 3 : Activate Insert mode
Press Insert key on keyboard or i
Step 4 : Type your program
Step 5 : Now save your program
type Press ESC then : then w
Step 6 : Now type the file name
hello.c press Enter
your program is saved now on disk.
Step 7 : Now exit from vi
press ESC then : then q
Step 8 : Now compile and link your program
type cc hello.c press enter
now you have a file a.out to run, if you want to give different name to output file
type cc -o hello hello.c press enter
Step 9 : Now execute ( run) your program
type ./a.out or ./hello according to the compiler option you used.
now you have done
now you have done
Still confused
0 comments:
Post a Comment