


Which was supposed to be named as stdio.h. In my case, the error was in the first line where I named the header file stdio incorrectly. Also, the error(s) are displayed as shown below.

If there's an error in the C program file, then it will not be compiled, obviously. c-program Compile and execute To C or not to C. Now, all there's left is to execute the file. You can always use the ls command to check the file contents of the directory: ls If your code is correct, it won't show any errors, and you will be given an executable file for your program. To compile this program, all you have to do is execute the GCC compiler in the following manner: gcc c-program.c -o c-program Save the file with a desired name and with a. Printf("Yes, this is a C program :) \n") Open any text editor and write a simple C program.įor example, here, I used Nano editor to edit the file in command line and wrote a C program that prints the value of sin30: #include The generated output file is executable and you can run this file to actually run your program./filename Example You specify the input C file name and an output name (usually recommended to keep the same name as the program filename but without the. Once you are ready with the compiler, you can write programs and compile and execute them. It includes all other compiling tools too. Installing may take several times.Optional: If you want to install an array of all the C and C++ related tools, you can install the clang package rather than gcc alone. Type Y and hit Enter when it is required. Sudo apt-get install codeblocks codeblocks-contrib Install: To install Code::Blocks run the final command.So run the following command through Terminal and wait till update successfully. Update PPA: After adding PPA your system need to update the latest PPA.When adding PPA, if need hit Enter do it. Insert your system password when it is required that won't be shown. Sudo add-apt-repository ppa:damien-moore/codeblocks-stable Adding PPA: Copy the following command and hit Enter from keyboard.Open Terminal: To open Terminal, type Ctlr + Alt + T from keyboard or search Terminal from Search box.To install CodeBlocks Stable Version on Ubuntu follow the instructions: We need to add the latest PPA of it and install through Terminal. The latest stable version of Code::Blocks is not available on Software Center. Also it is possible to run C/C++ on Sublime Text Editor. Personally I am using this for C/C++ Programs, though some time compile and run C/C++ Program through Ubuntu Terminal. Probably Code::Blocks is the most popular IDE to C/C++ Programmers to compile and build program.
