0% found this document useful (0 votes)
603 views11 pages

History of C

The document summarizes the history and development of the C programming language. It states that C was developed in 1972 by Dennis Ritchie at Bell Labs to develop the UNIX operating system. It was developed using the B programming language, which was itself based on the BCPL language developed by Martin Richards. C became widely popular and is now one of the most commonly used programming languages, with many modern operating systems like Linux and software programs being written in C due to its efficiency and ability to handle low-level tasks.

Uploaded by

Ad Nan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
603 views11 pages

History of C

The document summarizes the history and development of the C programming language. It states that C was developed in 1972 by Dennis Ritchie at Bell Labs to develop the UNIX operating system. It was developed using the B programming language, which was itself based on the BCPL language developed by Martin Richards. C became widely popular and is now one of the most commonly used programming languages, with many modern operating systems like Linux and software programs being written in C due to its efficiency and ability to handle low-level tasks.

Uploaded by

Ad Nan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

History of C language

By: Shakeel Ahamad


History of C language

 C programming is a general-purpose, procedural, imperative computer programming language.


 It was developed in 1972 by Dennis M. Ritchie at the AT &T bell Laboratories Murray hill New Jersey
to develop the UNIX operating system.
 C is the most widely used computer language.
 The C language is developed using the B language that is developed by the Ken Thompson at AT&T
Bell labs.
 The B language was adopted form a language called the BCPL (basic combined programming
language) which was developed by Martin Richards at Cambridge University.
Why to Learn C Programming?
• C programming language is a MUST for students and working
professionals to become a great Software Engineer specially when
they are working in Software Development Domain. Following are the
key advantages of learning C Programming:
• Easy to learn
• Structured language
• It produces efficient programs
• It can handle low-level activities
• It can be compiled on a variety of computer platforms
Facts about C
 C was invented to write an operating system called UNIX.
 C is a successor of B language which was introduced around the early 1970s.
 The language was formalized in 1988 by the American National Standard Institute (ANSI).Most of the
modern compiler conform to this standards.
 The UNIX OS was totally written in C.
 Today C is the most widely used and popular System Programming Language.
 Most of the state-of-the-art software have been implemented using C.
 Today's most popular Linux OS and RDBMS MySQL have been written in C.
Structure of a C Program

Preprocessor Directories
Pre-Processor Directives
• List of pre-processor directives :
• #include
• #define
• #undef
• #ifdef
• #ifndef
• #if
• #else
• #elif
• #endif
• #error
• #pragma
1. #include

• The #include pre-processor directive is used to paste code of given file into current file. It is used include
system-defined and user-defined header files. If included file is not found, compiler renders error. It has
three variants:

• #include <file>
• This variant is used for system header files. It searches for a file named file in a list of directories specified by
you, then in a standard list of system directories.

• #include "file"
• This variant is used for header files of your own program. It searches for a file named file first in the current
directory, then in the same directories used for system header files. The current directory is the directory of
the current input file.

• #include anything else


• This variant is called a computed #include. Any #include directive whose argument does not fit the above
two forms is a computed include.
2. Macro’s (#define)
• Let’s start with macro, as we discuss, a macro is a segment of code
which is replaced by the value of macro. Macro is defined by #define
directive.
Syntax

• #define token value


• There are two types of macros:

• Object-like Macros
• Function-like Macros
Object-like Macros
The object-like macro is an identifier that is #include <stdio.h>
replaced by value. It is widely used to represent #define PI 3.1415
numeric constants. For example:
main()
#define PI 3.1415
{
Here, PI is the macro name which will be
replaced by the value 3.14. Let’s see an example printf("%f",PI);
of Object-like Macros : }
Output: 3.14000
2. Function-like Macros
The function-like macro looks like #include <stdio.h>
function call. For example:
#define MIN(a,b) ((a)<(b)?(a):(b))
void main() {
#define MIN(a,b) ((a)<(b)?(a):(b))
printf("Minimum between 10 and 20 is: %d\n", MIN(10,20));
Here, MIN is the macro name.
Let’s see an example of Function- }
like Macros :
Output:

Minimum between 10 and 20 is: 10


Thank you

You might also like