About the Author
E Balagurusamy, former Vice Chancellor, Anna University, Chennai, is currently
Member, Union Public Service Commission, New Delhi. He is a teacher, trainer, and consultant
.
in the fields of information TechnologV and Management. He holds an ME (Hons) in
Electri.y and Management. He holds an ME (Hons) in
Electrical Engineering and Ph.D. in Systems Engineering from the indian institute of Technology,
Roorkee. His areas of interest include Object-Oriented Software Engineering, Electronic
.ect-Oriented Software Engineering, Electronic
Business, Technology Management, Business Process Re-engineering, and Total Quality
Management.
A prolific writer, he has authored a large number of research papers and several books.
His best selling books, among others, include:
. Programming in C#
. Programming in Java, 3/e
. Object-Oriented Programming with C++, 3/e
.ect-Oriented Programming with C++, 3/e
. Programming in BASIC, 3/e
. Numerical Methods
. Reliability Engineering
y Engineering
A recipient of numerous honours and awards, he has been listed in the Directory of Who's
Who of intellectuals and in the Directory of Distinguished Leaders in Education.
Preface to the Fourth
Edition
Cis a powerful, flexible, portable and elegantly structured programming language. Since
C combines the features of high-level language with the elements of the assembler, it is
suitable for both systems and applications programming. It is undoubtedly the most widely
J .terns and applications programming. It is undoubtedly the most widely
used general-purpose language today.
Since its standardization in 1989, C has undergone a series of changes and improvements
.fi,,,n,n,,,m 1'l - if',, - 1
in order to enhance the usefulness of the language. The version that incorDorates the new
o or porates the new
features is now referred to as C99. The fourth edition of ANSI C has been thoroughly revised
and enlarged not only to incorporate the numerous suggestions received both from teachers
and students across the country but also to highlight the enhancements and new features
added by C99.
J u99.
Organization of the book
The book starts with an overview of C, which talks about the history of C, basic structure of
C programs and their execution. The second chapter discusses how to declare the constants,
variables and data types. The third chapter describes the built-in operators and how to build
ypes. The third chapter describes the built-in operators and how to build
..
expressions using them. The fourth chapter details the input and output operations.
Deci.1.111..1 .1.1 ~ fry n j ~ 11if.Ill 1
sion making and branching is discussed in the fifth chapter, which talks about the if-else,
o and branching is discussed in the fifth chapter, which talks about the if-else,
switch and goto statements. Further, decision making and looping is discussed in Chapter
.1.11. 111 - "l^111,n 1llJ
six. which covers while. do and for fooDs. Arrays and ordered arrangement of data elements
, which covers while, do and for loops. Arrays and ordered arrangement of data elements
.
are important to any programming language and have been covered in chapters seven and
eight. Strings are also covered in Chapter eight. Chapters nine and ten are on functions,
structures and unions. Pointers, perhaps the most difficult part of C to understand, is
covered in Chapter eleven in the most user-friendly manner. Chapters twelve and thirteen
are on file management and dynamic memory allocation respectively. Chapter fourteen deals
with the preprocessor, and finally Chapter 15 is on developing a C program, which provides
..,l,11. I - 11,Inm 11'l .1 1
an insight on how to Droceed with develODment of a Drogram. The above organization would
.lit on how to proceed with development of a program. The above organization would
help the students in understanding C better if followed appropriately.
Xii Preface
New to the edition
The content has been revised keeping the updates which have taken placed in the field of C
programming and the present day syllabus needs. As always, the concept of 'learning by
example' has been stressed throughout the book. Each major feature of the language is
treated in depth followed by a complete program example to illustrate its use. The sample
programs are meant to be both simple and educational. Two new projects are added at the
end of the book for students to go through and try on their own.
Each chapter includes a section at the beginning to introduce the topic in a proper
perspective. It also provides a quick look into the features that are discussed in the chapter.
Wherever necessary, pictorial descriptions of concepts are included to improve clarity and to
facilitate better understanding. Language tips and other special considerations are
highlighted as notes wherever essential. In order to make the book more user-friendly, we have
incorporated the following key features.
O Codes with comments are provided throughout the book to illustrate how the
various features of the language are put together to accomplish specified tasks.
O SuPPlementrrry imp~rrtion abed notes that complement but stand apart from the
general text have been included in boxes.
O Guidelines for developing efficient C programs are given in the last chapter, together
with a list of some common mistookes that a less experienced C programmer could
make.
O Cause steadies at the end of the chapters illustrate common ways C features are put
together and also show real-life applications.
O The Joest Remember section at the end of the chapters lists out helpful hints and
possible problem areas.
O Numerous chapter-end questions and exercises provide ample opportunities to the
readers to review the concepts learned and to practice their applications.
O Progrrrmming projects discussed in the appendix give insight on how to integrate
the various features of C when handling large programs.
Supplementary Mntertul
With this revision we have tried to enhance the online learning center too. The
supplementary material would include the following:
For the instructor
Q Solutions to the debugging exercises
For the Student
Q Exclusive project for implementation with code, step-by-step description and user
manual
Q Code for the two projects (given in the book)
U Two mini projects
Q Reading material on C
This book is designed for all those who wish to be C programmers, regardless of their past
knowledge and experience in programming. It explains in a simple and easy-to-understand
style the what, why and how of programming with ANSI C.
E
