Skip to main content

How to Compile and Run a C Program on Ubuntu Linux

How to Compile and Run a C Program on Ubuntu Linux

In this post, we will learn how to set up an environment to compile and execute a c program on Ubuntu.

Introduction

In order to compile and execute a C program on Ubuntu, you need the following software
  • GNU Compiler Collection (GCC) 
  • Editor

GNU Compiler Collection (GCC) 

The good news is that the GNU Compiler Collection (GCC)  by default installed on your system you test via the following guideline.

Search for the terminal tool application in dash tool. Click once on the icon to open dash tool
Dash tool located on the left-top corner of your system.
Search word terminal in dash tool
Open terminal. Click on the terminal icon in order to open it. this will open terminal something like below.
 Check the GCC installation. type gcc --help on the terminal and hit the enter key
   this will display all available command in GCC.

Editor

You also need an editor where you can write your code or program. For now, you can use gedit. You can follow the below steps to open editor/gedit in your computer. 
  1. Click on dash tool and search word gedit 
  2. Double click on Text Editor
Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.

Comments

Popular posts from this blog

Function

Function A function is a relation between a set of inputs and a set of permissible outputs with the property that each input is related to exactly one output. Representation - Cartesian  product  of 2 sets is mapping every element to every element of other set. It is generally represented as X A={"a","b"}, B={"y","z"} then A X B= {("a","y"),("a","z"),(b,y),(b,z)} Relation: A Relation R from a non-empty set A to a non empty set B is a subset of cartesian product A X B. n(A)= number of element in set A. n(B)= number of element in set B. Let 's say n(A)=p, n(B)=q n(A X B)=pq then no of relations possible from A to B is 2^pq A relation f from a set A to a set B is said to function if every element of set A has one and only one image in set B. Relation: A function f is X to Y then f: X->Y X is called domain set, Y is called range function. Functions are generally represented as  f ( x ) L...

OFFSET in Computer Science

OFFSET in Computer Science In the post, We will understand what is the meaning of OFFSET in computer science with an example. In computer science offset comes picture at may place like packing a data structure, encoding the data etc in some standard protocol so that other parties can deserialise it and understand the data. We will understand its important how does it work with example. suppose we have a data structure for a student like { name:string[20] roll: int[4] course: string[25] batch: int[4] } We want to serialise below student data  { name:"Amit Gupta" roll: 1234 course:Computer Science" batch: 2018 } Our protocol follow the rule that we will insert a value and if space will remain empty we will fill it with $ for example length of "Amit Gupta" is 10 but standard size is 20 so will fill 10 $ after "Amit Gupta". So serialisation of above data will be Amit Gupta$$$$$$$$$$1234Computer Sc...

Install Virtual Environment

VIRTUAL ENV Virtualenv is a tool to create an isolated Python environment. In this post, we will learn how to setup virtualenv on ubuntu. Prerequisite pip Install Virtualenv If you have pip3  sudo pip3 install virtualenv if you have pip sudo pip install virtualenv Create a Virtualenv virtualenv venv venv is a directory in which virtual environment will be created. Working with Virtualenv source venv/bin/activate Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.

What is the difference between library and framework?

What is the difference between library and framework? In this post, We will learn about the very confusing term library and framework that widely used in software. Library and Framework Library: Library is a code repository that your code call. For example, curl is a library that can be called by your code. Framework: In a framework, framework call your code. For example, Django is a framework in which you keep your code in a particular structure can Django call your code compilation and execution purpose. Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.