PROGRAMMING
Introduction to C
,Objectives
• To discuss:
• 1. The Historical Background of C
• 2. The C program format
2.1 Memory concepts
2.2 Arithmetic in C
• 3. Control Structures
3.1 if selection statement
3.2 if-else selection statement
3.3 Switch multiple selection statement
3.4 While repetition statement
• 4. Assignment Operators
,1. THE HISTORICAL BACKGROUND
OF C
• C evolved from two previous languages, BCPL and B.
• BCPL was developed in 1967 by Martin Richards as a language for
writing operating systems and compilers.
• Ken Thompson modeled many features in his B language after the
counterparts in BCPL.
• In 1970, Thompson used B to create early versions of the UNIX
operating system at Bell Laboratories.
• The C language evolved from B by Dennis Ritchie at Bell Laboratori
and was originally implemented in 1972.
,• C initially became widely known as the development language of th
UNIX operating system.
• Many of today’s leading operating systems are written in C and/or
+.
• C is mostly hardware independent—with careful design, it’s possib
to write C programs that are portable to most computers.
• C is widely used to develop systems that demand performance, suc
as operating systems, embedded systems, real-time systems, and
communications systems
,• By the late 1970s, C had evolved into what’s now referred to as “tradition
C.”
• The publication in 1978 of Kernighan and Ritchie’s book, The C Programm
Language, drew wide attention to the language.
• This became one of the most successful computer science books of all tim
• Standardization The rapid expansion of C over various types of computer
(sometimes called hardware platforms) led to many variations that were
similar but often incompatible.
• This was a serious problem for programmers who needed to develop cod
that would run on several platforms.
, • It became clear that a standard version of C was needed.
• In 1983, the X3J11 technical committee was created under the American
National Standards Committee on Computers and Information Processing
to “provide an unambiguous and machine-independent definition of the
language.”
• In 1989, the standard was approved as ANSI X3.159-1989 through the
American National Standards Institute (ANSI), then worldwide through the
International Standards Organization (ISO). We call this simply Standard C.
• This standard was updated in 1999.
• We also introduce the new C standard (referred to as C11), which was
approved as this book went to publication around 2012.