Friday, December 24, 2010

What is a C programming language?


In this little blog we will discuss about, "what a C language is?" and "what are it's features?" in very brief just to gain some basic knowledge about a C program. C is a programming language which is considered to be a very very useful tool for a programmer but before discussing about what is a C program, let's first talk about, basically what a program is?
     In very simple language, "a program is a set of instructions which execute step by step sequentially."

C Programming Language

C was first developed in 1970’s at Bell Laboratories by Dennies Ritchie. Initially it was designed for programming in UNIX  operating system. Later in 1982, ANSI formed a committee to standardize the C language and finally in 1989 the standard for C language was introduce known as ANSI C.

Now let’s talk about its features:

  • C is known as the middle level language, because it lies between IInd generation language and IIIrd generation language.

  • C has got pre-defined structure and programmer should always follows the same predefined structure.

  • C is a function based language ie. to execute a data we must use a pre-defined C functions.

  • It has building block diagrams because the program is divided into many small blocks so that it becomes easier to execute a program correctly.

  • C is a case sensitive programming language  ie. 'A' and 'a' are two different character to C.

Syntax:

# include<stdio.h>
main()
{
Statement 1;
Statement 2;
Statement 3;
}






                    





 { = Opening braces
 } = closing braces
 ; = line terminator
 # = preprocessor
stdio=standard input/output file
.h = header file
<stdio.h>= to take I/P and O/P
 main( )=Very first function of c to start c program.


Data Types
   
C supports different types of data, the basic data types used in C are :

int
2 bytes
char
1 byte
float
4 bytes
double float
8 bytes




A simple C program
#include<stdio.h>
main()
{
printf("Hi \n");
printf("Welcome to Vikram Malla Blogs");
}



this is what actually a program does looks like in a compiler..

this is how the output do looks like once after it is executed.....