WEB DEVELOPER SITE
PYTHONPHP7JAVA
 

Learn C : Introduction


C is one of the most widely used computer programming languages.C is a general-purpose,reliable, simple and easy to use.Java programming language, which is also equally popular C continues to be the most widely used.

Features of C

  1. C run very fast in programming language
  2. Easy to learn for beginners
  3. Most powerful programming language
  4. Has many built-in functions and operators which can make complex programs easy
  5. Can be compiled on a number of computer platforms
  6. Fast and efficient excute power.
  7. Programs written in C are portable i.e., programs written for one type of computer or operating system can run on another type of computer or operating system with minimal modifications.
  8. Also largely used in many large-scale projects

Setup for C in computer platforms.

After writing any program, we need to compile and run it to see the output of the program.

This conversion is known as compiling a program. We compile a code with the help of a compiler. (which is binary language consisting of 0s and 1s)

Integrated Development Environment (IDE)

An IDE consists of a Text Editor as well as the Compiler. We type our program in the text editor which will then be compiled by the compiler.

C Compiler

After saving our program in a file with the .c extension, we need to compile it.

Text Editor


We write our program in a text editor. The file containing our program is called source file and is saved with .c extension.

Writing and compiling C program on Windows

many IDEs are available for editing and compiling C programs for Windows, here we are talking about editing and compiling program using DevC++ which allows us to edit, compile and run our program.

To write and compile in DevC++, follow the steps below.

1. On opening DevC++, you will get a window. Click on 'source file' option.

opening file in devc++

2. Write your C program in the white space as shown below and save it.

#include <stdio.h>
int main()
{
    printf("Hello World\n");
    return 0;
}

writing on file in devc++

writing on file in devc++

3. Once you have written the program, click on compile and run.

compiling C file in devc++

4. An output window will appear, showing the result that is "Hello World" printed.

Run C file in devc++

Now, you are ready to go for next chapter. We will explain this code in the next chapter.