Contact Us
  
 
 
    SearchSearch   RegisterRegister   Log inLog in 

step by step procedure to run a c program in ubuntu linux

step by step procedure to run a c program in ubuntu linux

 
Post new topic   Reply to topic     Forum Index -> Linux os
View previous topic :: View next topic  
Author Message
mac.jpr@gmail.com



Joined: 08 Jul 2009
Posts: 1

PostPosted: Wed Jul 08, 2009 3:34 pm    Post subject: step by step procedure to run a c program in ubuntu linux Reply with quote

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:
Code:
#include
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.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> Linux os All times are GMT
Page 1 of 1

 
Jump to:  
  Quick Post a Reply Topic
     
  Name (required)  
     
  Email Address (will not be published) (required)  
     
  Subject of topic (required)  
     
   
     
   
     
  Advertisement  
     
 
     


  More Links  
 
JSP Introduction
JSP Setup
Simple JSP Example
JSP Variable
Array Declaration in JSP
JSP Forms and User Input
Form Validation
JSP Cookies
JSP Session Object
Loop, content collection, iterator, conditional check in JSP
JSP Application Object
JSP Include
JSP Response Object
JSP Request Object
JSP Error Handling
JSP File Handling Object
JSP Action Tag
JSP Implicit Objects
JSP Declaration
JSP Directive
JDBC Introduction
JDBC Driver
JDBC Connection
JDBC Prepared/Statement
JDBC ResultSet
JDBC Close Connection object
JDBC Insert
JDBC Display Records
JDBC Update
JDBC Delete
JDBC Sorting
JDBC Query
JDBC Exception
JDBC Add Batch
JDBC Transaction/RollBack