Labels

Labels

Saturday 8 August 2015

How to run 'c' on Ubuntu Linux

How to run 'c' on Ubuntu Linux

(By- Jatin Bhutani)

This document explain how to run your your 'c' programs on Ubuntu Linux

what do u all need1. A system running Ubuntu.2. Your knowledge of programming of c 
 so lets do it!!!!


STEP 1:-  open terminal
 You can do this by searching terminal in the Ubuntu menu, or using a keyword 'Alt + Ctrl + T '   A terminal window will pop up like this.

open terminal


    And  you can always lock anything to the launcher if you need it very fast.

lock terminal





STEP 2:- use text editor for creating and editing a source file 


 Type in terminal
“ gedit hello.c”

what it will do :- It will create a file ,name as 'hello.c' 
*tip:- the source file for c are save as .c extension.

 pop up window of gedit will open, type your test code in the following format  
         

                            #include <stdio.h>

                               main()
                                           {

                                          printf ( "hello world, testing c om ubuntu\n" );
                                              }

close the editor window.


Step 2




STEP 3:- compile your program
Type a command
                                     gcc -o hello hello.c


this wil make the GNC compiler to compile the “hello.c” file in your home folder
the result will will be an executable file named as hello




STEP 4:- Execute your program
Type the command
./hello
the result should display this in output
hello world, testing c om ubuntu











so that is it,, so simple it was

 if you want to do a little advance try my pdf on the same topic" how to run c on ubuntu '



here is the link
http://bit.ly/1DCmKNu

https://www.dropbox.com/s/enbzs2kuzn3qvwv/Untitled%20Document%202.pdf?dl=0



No comments:

Post a Comment