C Programming

How To Use the C Programming Language in Ubuntu 20.04

C is an excellent procedural programming language for beginners who want to learn how to program. Many applications, including databases and operating systems, use this general-purpose programming language for development.

The C language is popular among new learners because it is not only easy to use but also helps programmers to better understand the internal architecture of the computer. C is the first step into the programming world, and after learning the C programming language, it will not be as difficult to learn other programming languages. Moreover, the C language is portable, as programs written in this language can be transferred to various platforms without requiring any changes to the code.

This article shows you how to use the C programming language in Ubuntu 20.04 (LTS) and 20.10.

Installing and Running the C Language

To begin working with the C programming language in Ubuntu, first, you will need to install it.

To make the C language run on Ubuntu, you first need to get its compiler, which can be installed through the installation of the build-essential development package. To install this package, launch the terminal and issue the following command:

$ sudo apt install build-essential

After the installation process of the build-essential package is completed, use the following command to view the version of the C compiler:

$ gcc --version

Now that you have installed the C compiler on your system, you can get started with the C language.

Writing Code in the C Language

First, open any text editor and write a simple C program. To run the program, open a text file and write a program in the file.

Save the file, naming it “HelloLinux” with the “.c” extension. Compile the code via the command provided below:

$ gcc –o HelloLinix HelloLinuc.c

To obtain the output of the program, type the filename in the terminal:

$ ./HelloLinux.c

Conclusion

This guide showed you how to make the C programming language work in Ubuntu. The C programming language is a general-purpose language that is used to develop graphics, applications, even games. For new programmers, the C language is the first step into the software development world, since it is easy to master. Even in 2020, the C language remains popular and relevant among developers due to its ubiquity and simplicity.

About the author

Avatar

Wardah Batool

I am a Software Engineer Graduate and Self Motivated Linux writer. I also love to read latest Linux books. Moreover, in my free time, i love to read books on Personal development.