

{"id":59169,"date":"2019-06-14T12:09:29","date_gmt":"2019-06-14T06:39:29","guid":{"rendered":"https:\/\/data-flair.training\/blogs\/?p=59169"},"modified":"2019-07-03T17:43:28","modified_gmt":"2019-07-03T12:13:28","slug":"install-c-on-linux","status":"publish","type":"post","link":"https:\/\/data-flair.training\/blogs\/install-c-on-linux\/","title":{"rendered":"How to Install C &#8211; Learn to Install GCC Compiler for Ubuntu"},"content":{"rendered":"<div class='__iawmlf-post-loop-links' style='display:none;' data-iawmlf-post-links='[{&quot;id&quot;:1502,&quot;href&quot;:&quot;https:\\\/\\\/en.wikipedia.org\\\/wiki\\\/GNU_Compiler_Collection&quot;,&quot;archived_href&quot;:&quot;http:\\\/\\\/web-wp.archive.org\\\/web\\\/20251003103908\\\/https:\\\/\\\/en.wikipedia.org\\\/wiki\\\/Gnu_Compiler_Collection&quot;,&quot;redirect_href&quot;:&quot;&quot;,&quot;checks&quot;:[{&quot;date&quot;:&quot;2025-12-09 09:31:43&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2025-12-12 14:35:23&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2025-12-16 13:30:31&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2025-12-19 13:41:19&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2025-12-22 23:06:02&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2025-12-26 13:11:33&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2025-12-29 13:26:13&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-01-01 14:54:41&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-01-04 18:49:18&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-01-07 21:18:37&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-01-11 00:53:26&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-01-14 03:00:50&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-01-17 05:55:15&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-01-20 13:32:02&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-01-24 17:01:26&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-01-28 06:41:53&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-01-31 08:26:21&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-02-03 09:05:16&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-02-06 11:21:24&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-02-09 14:40:52&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-02-12 19:21:28&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-02-15 20:33:23&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-02-18 20:52:41&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-02-21 21:24:10&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-02-25 05:31:24&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-02-28 13:00:23&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-03-03 19:20:54&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-03-07 12:52:45&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-03-11 00:57:36&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-03-14 07:49:41&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-03-17 19:24:04&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-03-20 23:15:14&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-03-24 02:58:20&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-03-27 07:12:57&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-03-30 09:00:52&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-04-02 19:04:56&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-04-05 19:43:49&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-04-08 19:50:50&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-04-12 13:56:09&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-04-16 17:31:24&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-04-19 20:26:05&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-04-22 21:37:00&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-04-26 16:14:01&quot;,&quot;http_code&quot;:429},{&quot;date&quot;:&quot;2026-04-30 09:39:13&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-05-03 10:19:23&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-05-06 18:35:24&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-05-10 05:27:30&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-05-13 07:36:08&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-05-16 17:14:01&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-05-20 15:18:38&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-05-24 06:05:12&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-05-27 08:30:23&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-05-30 18:19:14&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-06-03 07:11:11&quot;,&quot;http_code&quot;:200}],&quot;broken&quot;:false,&quot;last_checked&quot;:{&quot;date&quot;:&quot;2026-06-03 07:11:11&quot;,&quot;http_code&quot;:200},&quot;process&quot;:&quot;done&quot;}]'><\/div>\n<p><em><strong>How to Install C Programming Language?<\/strong><\/em><\/p>\n<p>Still stuck with the same problem of how to install C? You cannot install a programming language. Since C is a programming language, you directly start writing programs in it.<\/p>\n<p>Then what do you install?\u00a0The answer is- you need to install a Compiler, i.e. GCC Compiler, to compile and run your programs using it. This compiler recognizes the language by its syntax.<\/p>\n<h2>Steps to Install C Language<\/h2>\n<p>In this installation tutorial, we will help you to write and compile your own programs in the C programming language using terminal for Linux Operating System.<\/p>\n<h3>1. Environment for C programming<\/h3>\n<p>The terminal command prompt is pre-installed in your LINUX operating system.\u00a0Our task now is to install the GCC compiler using terminal to execute the C programs.<\/p>\n<p><em><strong>Check the<a href=\"https:\/\/data-flair.training\/blogs\/features-of-c\/\"> 8 Crucial Features of C Language<\/a> &amp; find the Reason behind its Popularity<\/strong><\/em><\/p>\n<h3>2. How to install GCC compiler using terminal in Linux?<\/h3>\n<p>You can find the terminal icon on your Desktop screen. If not, you can find it through the search menu. A shortcut to open terminal is: Press Ctrl + Alt + T.<\/p>\n<p>Open terminal so that we can proceed with the further steps to install the GCC Compiler.<\/p>\n<p>The main command for installing the GCC compiler using terminal on Ubuntu is:<\/p>\n<p><strong>sudo apt install GCC<\/strong><\/p>\n<p>Here, GCC is the C compiler.<\/p>\n<div id=\"attachment_59176\" style=\"width: 1309px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/GCC-is-the-C-compiler.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-59176\" class=\"size-full wp-image-59176\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/GCC-is-the-C-compiler.jpg\" alt=\"GCC is the C compiler\" width=\"1299\" height=\"741\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/GCC-is-the-C-compiler.jpg 1299w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/GCC-is-the-C-compiler-150x86.jpg 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/GCC-is-the-C-compiler-300x171.jpg 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/GCC-is-the-C-compiler-768x438.jpg 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/GCC-is-the-C-compiler-1024x584.jpg 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/GCC-is-the-C-compiler-520x297.jpg 520w\" sizes=\"auto, (max-width: 1299px) 100vw, 1299px\" \/><\/a><p id=\"caption-attachment-59176\" class=\"wp-caption-text\">GCC is the C compiler<\/p><\/div>\n<p>If you do not have permission to install the <a href=\"https:\/\/en.wikipedia.org\/wiki\/GNU_Compiler_Collection\">GCC<\/a> compiler, this message would be displayed where you are required to enter the admin password to get the permission granted:<\/p>\n<p>If you have permission, then the installation process will proceed as follows:<\/p>\n<div id=\"attachment_59177\" style=\"width: 1309px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/installation-process-of-gcc-Compiler.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-59177\" class=\"size-full wp-image-59177\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/installation-process-of-gcc-Compiler.jpg\" alt=\"installation process of gcc Compiler\" width=\"1299\" height=\"742\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/installation-process-of-gcc-Compiler.jpg 1299w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/installation-process-of-gcc-Compiler-150x86.jpg 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/installation-process-of-gcc-Compiler-300x171.jpg 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/installation-process-of-gcc-Compiler-768x439.jpg 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/installation-process-of-gcc-Compiler-1024x585.jpg 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/installation-process-of-gcc-Compiler-520x297.jpg 520w\" sizes=\"auto, (max-width: 1299px) 100vw, 1299px\" \/><\/a><p id=\"caption-attachment-59177\" class=\"wp-caption-text\">GCC Compiler Installation Process<\/p><\/div>\n<p>Type \u2018y\u2019 when the command prompt asks \u201cDo you want to continue?\u201d and then press Enter.<\/p>\n<p>Thereafter, your installation will begin<\/p>\n<div id=\"attachment_59178\" style=\"width: 1309px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/gcc-installation-will-begin.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-59178\" class=\"wp-image-59178 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/gcc-installation-will-begin.jpg\" alt=\"gcc installation begin\" width=\"1299\" height=\"741\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/gcc-installation-will-begin.jpg 1299w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/gcc-installation-will-begin-150x86.jpg 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/gcc-installation-will-begin-300x171.jpg 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/gcc-installation-will-begin-768x438.jpg 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/gcc-installation-will-begin-1024x584.jpg 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/gcc-installation-will-begin-520x297.jpg 520w\" sizes=\"auto, (max-width: 1299px) 100vw, 1299px\" \/><\/a><p id=\"caption-attachment-59178\" class=\"wp-caption-text\">gcc installation begins<\/p><\/div>\n<h3>3. How to check the installed compiler version?<\/h3>\n<ul>\n<li>You can find the terminal icon on your Desktop screen or on the search menu. A shortcut to open terminal is: Press Ctrl + Alt + T simultaneously.<\/li>\n<li>Now the terminal will open.<\/li>\n<li>The \u2018gcc\u2019 command will help you throughout your coding journey. It is a very important command that comes pre-installed on your latest Ubuntu version.<\/li>\n<li>Write the following command to know the version of the GCC compiler that you installed<\/li>\n<\/ul>\n<p><strong>GCC &#8212; version<\/strong><\/p>\n<p>\ufffcAfter pressing enter, the version of the terminal software would be displayed.<\/p>\n<div id=\"attachment_59179\" style=\"width: 1309px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/Display-version-of-the-terminal-software.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-59179\" class=\"size-full wp-image-59179\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/Display-version-of-the-terminal-software.jpg\" alt=\"Display version of the terminal software\" width=\"1299\" height=\"741\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/Display-version-of-the-terminal-software.jpg 1299w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/Display-version-of-the-terminal-software-150x86.jpg 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/Display-version-of-the-terminal-software-300x171.jpg 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/Display-version-of-the-terminal-software-768x438.jpg 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/Display-version-of-the-terminal-software-1024x584.jpg 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/Display-version-of-the-terminal-software-520x297.jpg 520w\" sizes=\"auto, (max-width: 1299px) 100vw, 1299px\" \/><\/a><p id=\"caption-attachment-59179\" class=\"wp-caption-text\">Displaying the version of the terminal software<\/p><\/div>\n<p>This version is 7.4.0<\/p>\n<p>If you don\u2019t see such a message on your display screen, then it probably means that you haven\u2019t successfully installed the GCC compiler.<\/p>\n<h3>4. How to create a C program?<\/h3>\n<p>In order to create a C program, use the \u2018touch\u2019 command and give the name of the file with .c extension<\/p>\n<p>But before that, you need to choose the directory you are working on.<\/p>\n<p>Most of the programmers generally prefer to work on the Desktop folder as it proves to be quite convenient to write, modify and run your programs instantly.<\/p>\n<p>In order to locate your files on the Desktop folder and to change the reference of the current directory to Desktop, use this command:<\/p>\n<p><strong>cd Desktop<\/strong><\/p>\n<div id=\"attachment_59181\" style=\"width: 1309px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/Insert-cd-Desktop-command.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-59181\" class=\"size-full wp-image-59181\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/Insert-cd-Desktop-command.jpg\" alt=\"Insert cd Desktop command\" width=\"1299\" height=\"741\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/Insert-cd-Desktop-command.jpg 1299w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/Insert-cd-Desktop-command-150x86.jpg 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/Insert-cd-Desktop-command-300x171.jpg 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/Insert-cd-Desktop-command-768x438.jpg 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/Insert-cd-Desktop-command-1024x584.jpg 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/Insert-cd-Desktop-command-520x297.jpg 520w\" sizes=\"auto, (max-width: 1299px) 100vw, 1299px\" \/><\/a><p id=\"caption-attachment-59181\" class=\"wp-caption-text\">Inserting cd Desktop command<\/p><\/div>\n<p><strong>Key takeaway:<\/strong> Commands are case sensitive<\/p>\n<p>The command for creating a program in C is:<\/p>\n<p><strong>touch program.c<\/strong><\/p>\n<p>Now, a file has been created in our Desktop folder called program.c<\/p>\n<div id=\"attachment_59184\" style=\"width: 1376px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/program.c-file-created.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-59184\" class=\"size-full wp-image-59184\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/program.c-file-created.png\" alt=\"File is created on desktop\" width=\"1366\" height=\"768\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/program.c-file-created.png 1366w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/program.c-file-created-150x84.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/program.c-file-created-300x169.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/program.c-file-created-768x432.png 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/program.c-file-created-1024x576.png 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/program.c-file-created-520x292.png 520w\" sizes=\"auto, (max-width: 1366px) 100vw, 1366px\" \/><\/a><p id=\"caption-attachment-59184\" class=\"wp-caption-text\">The file is created on the desktop<\/p><\/div>\n<p>Open this file and write a basic code &#8211; <strong>\u201cHello World!\u201d<\/strong><\/p>\n<div id=\"attachment_59185\" style=\"width: 1309px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/Hello-World-in-gcc-terminal.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-59185\" class=\"size-full wp-image-59185\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/Hello-World-in-gcc-terminal.jpg\" alt=\"Hello World in gcc terminal\" width=\"1299\" height=\"742\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/Hello-World-in-gcc-terminal.jpg 1299w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/Hello-World-in-gcc-terminal-150x86.jpg 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/Hello-World-in-gcc-terminal-300x171.jpg 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/Hello-World-in-gcc-terminal-768x439.jpg 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/Hello-World-in-gcc-terminal-1024x585.jpg 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/Hello-World-in-gcc-terminal-520x297.jpg 520w\" sizes=\"auto, (max-width: 1299px) 100vw, 1299px\" \/><\/a><p id=\"caption-attachment-59185\" class=\"wp-caption-text\">Hello World in C Programming<\/p><\/div>\n<h3>5. How to compile and run a C program?<\/h3>\n<p>Now that we have created a C program called program.c, it is now time to compile it and run it in terminal.<\/p>\n<p>To compile the code, we use the GCC command:<\/p>\n<p><strong>GCC program.c -o program<\/strong><\/p>\n<div id=\"attachment_59191\" style=\"width: 1309px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/Compile-code-using-GCC-command.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-59191\" class=\"size-full wp-image-59191\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/Compile-code-using-GCC-command.jpg\" alt=\"Compile code using GCC command\" width=\"1299\" height=\"742\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/Compile-code-using-GCC-command.jpg 1299w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/Compile-code-using-GCC-command-150x86.jpg 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/Compile-code-using-GCC-command-300x171.jpg 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/Compile-code-using-GCC-command-768x439.jpg 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/Compile-code-using-GCC-command-1024x585.jpg 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/Compile-code-using-GCC-command-520x297.jpg 520w\" sizes=\"auto, (max-width: 1299px) 100vw, 1299px\" \/><\/a><p id=\"caption-attachment-59191\" class=\"wp-caption-text\">Compile code using GCC command<\/p><\/div>\n<p>Here, the &#8216;gcc&#8217; command is followed by the file name with .c extension and \u2018-o\u2019 and the name of the executable file, which is, \u2018program\u2019 in this case.<\/p>\n<p><strong>Key takeaway:<\/strong> The executable file name can be different from the source file name<\/p>\n<p>In order to run the program, use the command<\/p>\n<p><strong>.\/program<\/strong><\/p>\n<div id=\"attachment_59189\" style=\"width: 1309px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/Run-the-code-using-porgram-command.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-59189\" class=\"size-full wp-image-59189\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/Run-the-code-using-porgram-command.jpg\" alt=\"Run the code using program command\" width=\"1299\" height=\"741\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/Run-the-code-using-porgram-command.jpg 1299w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/Run-the-code-using-porgram-command-150x86.jpg 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/Run-the-code-using-porgram-command-300x171.jpg 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/Run-the-code-using-porgram-command-768x438.jpg 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/Run-the-code-using-porgram-command-1024x584.jpg 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/Run-the-code-using-porgram-command-520x297.jpg 520w\" sizes=\"auto, (max-width: 1299px) 100vw, 1299px\" \/><\/a><p id=\"caption-attachment-59189\" class=\"wp-caption-text\">Run the code using .\/program command<\/p><\/div>\n<p>Here, the period symbol \u2018.\u2019 followed by a backslash is followed by the name of the executable file, that is, \u2018program\u2019 in this case<\/p>\n<p>The program output would be:<\/p>\n<div id=\"attachment_59190\" style=\"width: 1309px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/Output-of-Program.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-59190\" class=\"size-full wp-image-59190\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/Output-of-Program.jpg\" alt=\"Output of Program\" width=\"1299\" height=\"742\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/Output-of-Program.jpg 1299w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/Output-of-Program-150x86.jpg 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/Output-of-Program-300x171.jpg 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/Output-of-Program-768x439.jpg 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/Output-of-Program-1024x585.jpg 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/Output-of-Program-520x297.jpg 520w\" sizes=\"auto, (max-width: 1299px) 100vw, 1299px\" \/><\/a><p id=\"caption-attachment-59190\" class=\"wp-caption-text\">Output of Program<\/p><\/div>\n<h2>Summary<\/h2>\n<p>In this way, you can install the GCC compiler using terminal when working on the LINUX OS. We inferred that it is pretty easy to install the GCC compiler in LINUX as it requires only one command.\u00a0Thereafter, we saw how to check the version of the installed compiler. Then, we saw how to create a program in C with the help of certain commands. Finally, we learned how to compile and run C programs using terminal.<\/p>\n<p>We hope you found this tutorial helpful for installing the GCC compiler using terminal for LINUX!<\/p>\n<p>If you have any queries regarding the installation process or if you&#8217;re finding any difficulties to install C in your system feel free to leave a comment below.<\/p>\n<p><em><strong>Don&#8217;t forget to check\u00a0<a href=\"https:\/\/data-flair.training\/blogs\/applications-of-c\/\">Applications of C Programming<\/a> That Will Make You Fall In Love With C<\/strong><\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>How to Install C Programming Language? Still stuck with the same problem of how to install C? You cannot install a programming language. Since C is a programming language, you directly start writing programs&#46;&#46;&#46;<\/p>\n","protected":false},"author":5,"featured_media":59197,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[19488],"tags":[20119,20121,20117,20122,20118,20120],"class_list":["post-59169","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-c-programming","tag-c-language-install","tag-how-to-install-c-in-linux","tag-install-c","tag-install-c-linux","tag-install-c-on-ubuntu","tag-installation-of-c"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Install C - Learn to Install GCC Compiler for Ubuntu - DataFlair<\/title>\n<meta name=\"description\" content=\"These are Steps to Install C using gcc compiler on linux (ubuntu) Operating system. This installtion process also guide you to write &amp; run your first program\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/data-flair.training\/blogs\/install-c-on-linux\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Install C - Learn to Install GCC Compiler for Ubuntu - DataFlair\" \/>\n<meta property=\"og:description\" content=\"These are Steps to Install C using gcc compiler on linux (ubuntu) Operating system. This installtion process also guide you to write &amp; run your first program\" \/>\n<meta property=\"og:url\" content=\"https:\/\/data-flair.training\/blogs\/install-c-on-linux\/\" \/>\n<meta property=\"og:site_name\" content=\"DataFlair\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/DataFlairWS\/\" \/>\n<meta property=\"article:published_time\" content=\"2019-06-14T06:39:29+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-07-03T12:13:28+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/Install-GCC-Compiler-to-run-C.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"802\" \/>\n\t<meta property=\"og:image:height\" content=\"420\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"DataFlair Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:site\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"DataFlair Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Install C - Learn to Install GCC Compiler for Ubuntu - DataFlair","description":"These are Steps to Install C using gcc compiler on linux (ubuntu) Operating system. This installtion process also guide you to write & run your first program","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/data-flair.training\/blogs\/install-c-on-linux\/","og_locale":"en_US","og_type":"article","og_title":"How to Install C - Learn to Install GCC Compiler for Ubuntu - DataFlair","og_description":"These are Steps to Install C using gcc compiler on linux (ubuntu) Operating system. This installtion process also guide you to write & run your first program","og_url":"https:\/\/data-flair.training\/blogs\/install-c-on-linux\/","og_site_name":"DataFlair","article_publisher":"https:\/\/www.facebook.com\/DataFlairWS\/","article_published_time":"2019-06-14T06:39:29+00:00","article_modified_time":"2019-07-03T12:13:28+00:00","og_image":[{"width":802,"height":420,"url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/Install-GCC-Compiler-to-run-C.jpg","type":"image\/jpeg"}],"author":"DataFlair Team","twitter_card":"summary_large_image","twitter_creator":"@DataFlairWS","twitter_site":"@DataFlairWS","twitter_misc":{"Written by":"DataFlair Team","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/data-flair.training\/blogs\/install-c-on-linux\/#article","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/install-c-on-linux\/"},"author":{"name":"DataFlair Team","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/7f83c342f5d1632d6f7b4b0b0f447823"},"headline":"How to Install C &#8211; Learn to Install GCC Compiler for Ubuntu","datePublished":"2019-06-14T06:39:29+00:00","dateModified":"2019-07-03T12:13:28+00:00","mainEntityOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/install-c-on-linux\/"},"wordCount":939,"commentCount":3,"publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/install-c-on-linux\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/Install-GCC-Compiler-to-run-C.jpg","keywords":["c language install","how to install c in linux","install c","install c linux","install C on ubuntu","installation of c"],"articleSection":["C Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/data-flair.training\/blogs\/install-c-on-linux\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/data-flair.training\/blogs\/install-c-on-linux\/","url":"https:\/\/data-flair.training\/blogs\/install-c-on-linux\/","name":"How to Install C - Learn to Install GCC Compiler for Ubuntu - DataFlair","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/install-c-on-linux\/#primaryimage"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/install-c-on-linux\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/Install-GCC-Compiler-to-run-C.jpg","datePublished":"2019-06-14T06:39:29+00:00","dateModified":"2019-07-03T12:13:28+00:00","description":"These are Steps to Install C using gcc compiler on linux (ubuntu) Operating system. This installtion process also guide you to write & run your first program","breadcrumb":{"@id":"https:\/\/data-flair.training\/blogs\/install-c-on-linux\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/data-flair.training\/blogs\/install-c-on-linux\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/install-c-on-linux\/#primaryimage","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/Install-GCC-Compiler-to-run-C.jpg","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/06\/Install-GCC-Compiler-to-run-C.jpg","width":802,"height":420,"caption":"How to Install C with GCC Compiler"},{"@type":"BreadcrumbList","@id":"https:\/\/data-flair.training\/blogs\/install-c-on-linux\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog Home","item":"https:\/\/data-flair.training\/blogs\/"},{"@type":"ListItem","position":2,"name":"C Tutorials","item":"https:\/\/data-flair.training\/blogs\/category\/c-programming\/"},{"@type":"ListItem","position":3,"name":"How to Install C &#8211; Learn to Install GCC Compiler for Ubuntu"}]},{"@type":"WebSite","@id":"https:\/\/data-flair.training\/blogs\/#website","url":"https:\/\/data-flair.training\/blogs\/","name":"DataFlair","description":"Learn Today. Lead Tomorrow.","publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/data-flair.training\/blogs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/data-flair.training\/blogs\/#organization","name":"DataFlair","url":"https:\/\/data-flair.training\/blogs\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","width":106,"height":48,"caption":"DataFlair"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/DataFlairWS\/","https:\/\/x.com\/DataFlairWS","https:\/\/www.linkedin.com\/company\/dataflair-web-services-pvt-ltd\/","https:\/\/www.youtube.com\/user\/DataFlairWS"]},{"@type":"Person","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/7f83c342f5d1632d6f7b4b0b0f447823","name":"DataFlair Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/4cf3a74600d131330b8c481d519afd1574093ed89f6d3396a95393ad223eb7cd?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/4cf3a74600d131330b8c481d519afd1574093ed89f6d3396a95393ad223eb7cd?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/4cf3a74600d131330b8c481d519afd1574093ed89f6d3396a95393ad223eb7cd?s=96&d=mm&r=g","caption":"DataFlair Team"},"description":"DataFlair Team creates expert-level guides on programming, Java, Python, C++, DSA, AI, ML, data Science, Android, Flutter, MERN, Web Development, and technology. Our goal is to empower learners with easy-to-understand content. Explore our resources for career growth and practical learning.","url":"https:\/\/data-flair.training\/blogs\/author\/dfteam1\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/59169","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/comments?post=59169"}],"version-history":[{"count":5,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/59169\/revisions"}],"predecessor-version":[{"id":61987,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/59169\/revisions\/61987"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media\/59197"}],"wp:attachment":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media?parent=59169"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/categories?post=59169"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/tags?post=59169"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}