Вы находитесь на странице: 1из 1

after installing the latest version of Linux and installing all updates

1. open terminal program :which is in applications-accessories-terminal.


# for 2 and 3 step you need an internet connection.
2. type in the terminal: sudo apt-get update
3. type in the terminal: sudo apt-get install build-essential
4. go to the location where you have to save your c file by using cd command
in the terminal : mine is "cd Documents"
5. type: gedit filename.c :this will open a new window where you can type your
c commands. remember getch() in windows is getchar() and no need of clrscr():
I have written "gedit hahah.c" and then in the gedit window I wrote:
"#include<stdio.h>
main()
{
printf("ha..ha..ha..");
getchar();
}"
6. save that file
7. open the terminal and type :gcc filename.c :mine is gcc hahah. this will
compile the c program and a file named a.out will be autometically created in
the folder you have your c file.(remember you should be in that particular place
in the terminal where you have stored the c file )
8.type ./a.out in the terminal program.
hurrreee this will run your c program.
9. press exit to exit the editor.

Вам также может понравиться