Basic Computation and Principles of Computer Programming An Introduction to Computing WBUT 2015 4th Edition E. Balagurusamy instant download
Basic Computation and Principles of Computer Programming An Introduction to Computing WBUT 2015 4th Edition E. Balagurusamy instant download
https://ebookultra.com/download/basic-computation-and-principles-
of-computer-programming-an-introduction-to-computing-
wbut-2015-4th-edition-e-balagurusamy/
https://ebookultra.com/download/fundamentals-of-computer-and-
programming-2nd-edition-e-balagurusamy/
https://ebookultra.com/download/object-oriented-programming-in-c-4th-
edition-e-balagurusamy/
https://ebookultra.com/download/python-programming-an-introduction-to-
computer-science-john-m-zelle/
https://ebookultra.com/download/programming-in-c-a-primer-3rd-edition-
e-balagurusamy/
Introduction to Languages and the Theory of Computation
4th Edition John Martin
https://ebookultra.com/download/introduction-to-languages-and-the-
theory-of-computation-4th-edition-john-martin/
https://ebookultra.com/download/basic-pathology-an-introduction-to-
the-mechanisms-of-disease-4th-ed-edition-dilly/
https://ebookultra.com/download/an-introduction-to-object-oriented-
programming-with-visual-basic-net-1st-edition-dan-clark/
https://ebookultra.com/download/an-introduction-to-programming-using-
visual-basic-2008-with-visual-studio-expression-edition-dvd-schneider/
E Balagurusamy
Chairman
EBG Foundation
Coimbatore, Tamil Nadu
Information contained in this work has been obtained by McGraw Hill Education (India), from sources believed to be reliable.
However, neither McGraw Hill Education (India) nor its authors guarantee the accuracy or completeness of any information
published herein, and neither McGraw Hill Education (India) nor its authors shall be responsible for any errors, omissions, or
damages arising out of use of this information. This work is published with the understanding that McGraw Hill Education (India)
and its authors are supplying information but are not attempting to render engineering or other professional services. If such services
are required, the assistance of an appropriate professional should be sought.
Typeset at Text-o-Graphics, B1/56, Aravali Apartment, Sector 34, Noida 201301 and printed at
Cover Printer:
Contents
Preface xi
Roadmap to the Syllabus xiii
1. Fundamentals of Computers 1
1.1 Introduction 1
1.2 History of Computers 2
1.3 Generations of Computers 5
1.4 Classification of Computers 8
1.5 Basic Anatomy of a Computer System 10
1.6 Input Devices 10
1.7 Processor 13
1.8 Output Devices 14
1.9 Memory Management 16
1.10 Overview of Operating System 17
Review Questions 23
2. Computing Concepts 25
2.1 Introduction 25
2.2 Binary Number System 25
2.3 Decimal Number System 28
2.4 Octal Number System 29
2.5 Hexadecimal Number System 30
2.6 Conversion from Any Base Number System to Any Other Base Number 31
2.7 Binary Codes 32
2.8 Binary Arithmetic Operations 33
2.9 Logic Gates 37
2.10 Programming Languages 41
2.11 Translator Programs 43
2.12 Algorithm and Flow Chart 44
2.13 Using the Computer 47
Review Questions 47
Review Exercises 48
vi Contents
Bibliography 507
Preface
C is a powerful, flexible, portable and elegantly structured programming language. Since C com-
bines the features of a high-level language with the elements of the assembler, it is suitable for
both systems and applications programming. It is undoubtedly the most widely used general-purpose
language today.
This book is designed for BTech first-year, second-semester students of West Bengal University
of Technology taking the paper on Basic Computation and Principles of Computer Programming
(CS201). This book will also be useful for students taking diploma courses in computer science.
All those who wish to be C programmers, regardless of their past knowledge and experience in pro-
gramming, will find this book very useful for it explains the ‘what’, ‘why’ and ‘how’ of programming
with C in the most easy-to-understand manner.
The writing style uses and emphasizes on the concept of ‘learning by example’. Each major fea-
ture of the language is explained in a comprehensive manner and supported with complete program
examples to illustrate its use. The sample programs are designed to be both simple and educational.
Wherever necessary, pictorial descriptions of concepts are included to improve clarity and facilitate
better understanding.
Salient Features
� 100% coverage and organization as per the WBUT syllabus
� Latest WBUT Solved Examination Question Papers (2012, 2013 and 2012)
� Provides good understanding of both computing fundamentals and programming nuances
� In-depth discussion of operators, expressions, arrays, and pointers
� Dedicated chapter providing guidelines for developing C programs
� Case studies in every chapter comprise problem, problem analysis and program demonstrating
real-life applications
� Special features include supplementary notes and information in special boxes, ‘Just Remember’
section at chapter-end summarizes the main points
� Rich Pedagogy includes:
� 500+ Review Questions comprising True and False, Fill in the Blanks, Find the Errors, and
Objective-Type Questions
� 175 Programming Exercises to practice programming applications
� 105 Solved Examples
� 22 Case Studies
� 145 Illustrations
xii Preface
Chapter Organization
The contents of the book have been divided into 15 chapters. Chapter 1 introduces the subject
describing the history of computers, the different generations of computers and their classification and
input and output devices. It also gives an overview of operating systems. Chapter 2 introduces the
binary number system and explains the procedure for writing algorithms and flowcharts. Chapter 3
discusses how to declare constants, variables and data types. Chapter 4 is on built-in operators and
explains how to build expressions using them. Chapter 5 details input and output operations. Decision
making and branching is discussed in Chapter 6. It describes the if-else, switch and goto statements.
Further, decision making and looping is discussed in Chapter 7 which covers the while, do and
for loops. Functions are discussed in Chapter 8. Chapter 9 deals with preprocessors. Arrays and
ordered arrangement of data elements, important to any programming language, have been covered
in Chapters 10 and 11. Chapter 11 also explains strings. Pointers, commonly perceived as a difficult
topic in C, are covered in Chapter 12 in the most lucid manner. Chapter 13 is on structures and unions.
Chapter 14 discusses file management. Finally, Chapter 15 is on developing a C program. It provides
a comprehensive understanding of the procedures for the development of a program.
Solved WBUT examination papers (2012 to 2014) are provided for students’ practice and self-
assessment toward the book’s end.
Acknowledgements
I am grateful to the following reviewers for taking out time and sharing their valuable comments after
going through various chapters of the book.
Susanta Mitra Adamas Institute of Technology, Kolkata
Sinthia Roy Guru Nanak Institute of Technology, Kolkata
Debasis Giri Haldia Institute of Technology, Medinipur
Anup Mallick Regent Education and Research Foundation, Kolkata
Rinku Supakar Dr Sudhir Chandra Sur Degree Engineering College, Kolkata
Jayanta Pal Narula Institute of Technology, Kolkata
I am also thankful to the staff of McGraw Hill Education (India) for their cooperation and support
in bringing out this book on time.
Suggestions for improvement are always welcome.
E BALAGURUSAMY
Publisher’s Note
Remember to write to us. We look forward to receiving your feedback, comments and ideas to en-
hance the quality of this book. You can reach us at [email protected]. Please mention the
title and author’s name as the subject. In case you spot piracy of this book, please do let us know.
Roadmap to the Syllabus
This textbook is useful for Subject Code:
Basic Computation and Principles of Computer Programming (CS201)
Unit 2 - C Fundamentals
The C character set identifiers and keywords, data types and sizes, variable names, declaration,
statements.
Chapter 10 Arrays
GO TO Chapter 11 Character Arrays and Strings
Chapter 12 Pointers
1
Fundamentals of Computers
1.1 INTRODUCTION
The term computer is derived from the word compute. A computer is an electronic device that takes
data and instructions as an input from the user, processes data, and provides useful information known
as output. This cycle of operation of a computer is known as the input–process–output cycle and is
shown in Fig.1.1 The electronic device is known as hardware and the set of instructions is known as
software.
INPUT OUTPUT
Data PROCESS Information
Instructions
1.D. The copyright laws of the place where you are located also
govern what you can do with this work. Copyright laws in most
countries are in a constant state of change. If you are outside the
United States, check the laws of your country in addition to the
terms of this agreement before downloading, copying, displaying,
performing, distributing or creating derivative works based on this
work or any other Project Gutenberg™ work. The Foundation makes
no representations concerning the copyright status of any work in
any country other than the United States.
1.E.6. You may convert to and distribute this work in any binary,
compressed, marked up, nonproprietary or proprietary form,
including any word processing or hypertext form. However, if you
provide access to or distribute copies of a Project Gutenberg™ work
in a format other than “Plain Vanilla ASCII” or other format used in
the official version posted on the official Project Gutenberg™ website
(www.gutenberg.org), you must, at no additional cost, fee or
expense to the user, provide a copy, a means of exporting a copy, or
a means of obtaining a copy upon request, of the work in its original
“Plain Vanilla ASCII” or other form. Any alternate format must
include the full Project Gutenberg™ License as specified in
paragraph 1.E.1.
• You pay a royalty fee of 20% of the gross profits you derive
from the use of Project Gutenberg™ works calculated using the
method you already use to calculate your applicable taxes. The
fee is owed to the owner of the Project Gutenberg™ trademark,
but he has agreed to donate royalties under this paragraph to
the Project Gutenberg Literary Archive Foundation. Royalty
payments must be paid within 60 days following each date on
which you prepare (or are legally required to prepare) your
periodic tax returns. Royalty payments should be clearly marked
as such and sent to the Project Gutenberg Literary Archive
Foundation at the address specified in Section 4, “Information
about donations to the Project Gutenberg Literary Archive
Foundation.”
• You comply with all other terms of this agreement for free
distribution of Project Gutenberg™ works.
1.F.
1.F.4. Except for the limited right of replacement or refund set forth
in paragraph 1.F.3, this work is provided to you ‘AS-IS’, WITH NO
OTHER WARRANTIES OF ANY KIND, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO WARRANTIES OF
MERCHANTABILITY OR FITNESS FOR ANY PURPOSE.
Please check the Project Gutenberg web pages for current donation
methods and addresses. Donations are accepted in a number of
other ways including checks, online payments and credit card
donations. To donate, please visit: www.gutenberg.org/donate.
Most people start at our website which has the main PG search
facility: www.gutenberg.org.
Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.
ebookultra.com