C Programming
This is an introduction to C programming language.
Dennis Ritchie in 1972 at AT&T Bell Laboratories designed C. In the year 1989, American National Standards Institute approved a version knows as ANSI C.
C is a structured programming language. We can break up a problem into small modules or function blocks and then join them together to get the complete program.
C source code is compiled.
A compiler reads the entire source code and converts it into object code also referred to as machine code or binary code. Source code is written in human understandable form so, it is necessary to translated it into machine code using compiler which the computer can execute easily.
It is a free-form language i.e. the compiler is not worried about from where we start writing our code.
C programs are a collection of modules or functions. These functions are either user-defined functions, written by a programmer, or standard library functions, provided by the compiler.
Many other programming languages like C++, Java, PHP, JavaScript etc. have borrowed their syntax or were inspired from the C programming language. In fact C++ is a superset of C and is also referred as "C with Classes".
In order to write and compile C code we will need a compiler.
You can use any of the following IDEs for writing and compiling C program.
We save C source code in a file with the .c
extension.
Example: foo.c
Open your IDE and create a new file lets say, helloworld.c
and write the following code inside it.
#include <stdio.h>
int main(void) {
printf("Hello World");
return 0;
}
We will cover the details of the above code in the later tutorials.
Now, if you run this file (compile and execute) you will get "Hello World" as the output.
ADVERTISEMENT