Programare C

How To Use the C Programming Language in Ubuntu 20.04

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.

Cum să dezvolți un joc pe Linux
Acum un deceniu, nu mulți utilizatori de Linux ar fi prezis că sistemul lor de operare preferat va fi într-o zi o platformă populară de jocuri pentru ...
Open Source Ports of Commercial Game Engines
Free, open source and cross-platform game engine recreations can be used to play old as well as some of the fairly recent game titles. This article wi...
Cele mai bune jocuri de linie de comandă pentru Linux
Linia de comandă nu este doar cel mai mare aliat al tău când folosești Linux - poate fi și sursa de divertisment, deoarece poți să o folosești pentru ...