C programming

Posted on: May 9, 2018, by :

1. Save the code in a file say hello.c (quotes for clarity).

4. For viewing output of the program, press (Alt+F5).

3. PressCtrl+F9to compile the program. If there are any compile-time errors then fix them.

1. Write your code to a file and save it.

Compiling and running C programs in GCC compiler

Computer programming means giving instructions to a computer and to interact with it we need a language to communicate. There are many languages such as C, C++, Java, Python and many others each having their own features. Lets discuss first why we need programming suppose you are given ten numbers and asked to arrange them in ascending order then you can do it easily, but what if the numbers are, say ten thousand it will be a difficult task and will take a long time manually and the result may also contain errors. To simplify this task we can write a program which does it and if the algorithm is correct then we will get an accurate result in a short amount of time depending on the processor speed, this is where programming is helpful.

C programming language: To easily learn C language you must start making programs in it. As you may already know that to develop programs you need a text editor and a compiler to translate a source program into machine code which can be executed directly on a machine. Dev C++ IDE is a good choice, so if you are not having it installed on your computer then downloadDev C++ compiler.

hello.out is the name of output file.

2. To compile open terminal and type gcc hello.c.

Programming Simplifiedis licensed under aCreative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.

You can also specify the output file name as:

Now you have the tool to create programs, if you wish to look at some example codes then seeC programming examples. Now I will explain to you how to compile and run your programs. You may be using a different compiler or operating system. I will explain to you how to use Dev C++, GCC and Turbo C compiler.

C programming

Leave a Reply