What is C language
C is a general-purpose, procedural programming language. Dennis Ritchie first
devised C in the 1970s (at AT&T Bell Laboratories in Murray Hill, New Jersey) for
the purpose of implementing the Unix operating system and utilities with the
greatest possible degree of independence from specific hardware platforms. The
key characteristics of the C language are the qualities that made it suitable for that
Source code portability
The ability to operate “close to the machine”
As a result, the developers of Unix were able to write most of the operating system
in C, leaving only a minimum of system-specific hardware manipulation to be
coded in assembly.
Because C was expressly designed for system programming, it is hardly surprising
that one of its major uses today is in programming embedded systems. At the
same time, however, many developers use C as a portable, structured high-level
language to write programs such as powerful word processor, database, and
History of C
Here we are discussing brief history of c language. It was developed to supersede the drawback of previous languages such as B, BCPL etc.
Initially, C language was developed to be used in UNIX operating system. It inherits many features of previous languages such as B and BCPL.
Let's see the programming languages that were developed before C language.
|Traditional C||1972||Dennis Ritchie|
|K & R C||1978||Kernighan & Dennis Ritchie|
|ANSI C||1989||ANSI Committee|
Features of C
C is the widely used language. It provides a rich setfeatures that are given below.
Machine Independent or Portable
Mid-level programming language
structured programming language
First C Program
Every C program must define at least one function of its own, with the special
name main( ): this is the first function invoked when the program starts. The
main( ) function is the program’s top level of control, and can call other functions
Example for first C Program.
It is the preprocessor command. It is the first statement of the program.
It starts with a hash (#) symbol.
The #include will tell the compiler to include the standard input/output library file (stdio.h).
main is first funtion of any c program and return value is int.
The curly brackets are used to put together block of statements called body of function.
printf(“ Hello World\n”);
The printf function is already defined in the stdio.h file.
It is used for printing the text on console.
'\n' is an escape character which represents a newline character.
returns 0 indicates sucessfrul termination of function.
int main( )