third Edition
Ashok N. Kamthane
Associate Professor
Shri Guru Gobind Singhji Institute of Engineering
and Technology, Nanded, Maharashtra, India
A01_KAMT3553_02_SE_FM.indd 1 5/17/2015 8:59:35 AM
, DEDI CAT I O N
To My Beloved Late Grandfather
Jagganath Kamthane
Associate Editor—Acquisitions: Neha Goomer
Editor—Production: G Sharmilee
Copyright © 2015 Pearson India Education Services Pvt. Ltd
Copyright © 2006, 2012 Dorling Kindersley (India) Pvt. Ltd
This book is sold subject to the condition that it shall not, by way of trade or otherwise, be lent, resold,
hired out, or otherwise circulated without the publisher’s prior written consent in any form of binding
or cover other than that in which it is published and without a similar condition including this condition
being imposed on the subsequent purchaser and without limiting the rights under copyright reserved
above, no part of this publication may be reproduced, stored in or introduced into a retrieval system, or
transmitted in any form or by any means (electronic, mechanical, photocopying, recording or otherwise),
without the prior written permission of both the copyright owner and the publisher of this book.
ISBN 978-93-325-4355-3
First Impression
Published by Pearson India Education Services Pvt. Ltd, CIN: U72200TN2005PTC057128, formerly
known as TutorVista Global Pvt. Ltd, licensee of Pearson Education in South Asia.
Head Office: A-8(A), 7th Floor, Knowledge Boulevard, Sector 62, Noida 201 309, Uttar Pradesh, India.
Registered Office: Module G4, Ground Floor, Elnet Software City, TS-140, Block 2 & 9,
Rajiv Gandhi Salai, Taramani, Chennai 600 113, Tamil Nadu, India.
Fax: 080-30461003, Phone: 080-30461060
www.pearson.co.in, Email:
Compositor: Mukesh Technologies Pvt. Ltd
Printed in India
A01_KAMT3553_02_SE_FM.indd 2 5/17/2015 8:59:36 AM
, Contents
Preface xi
Acknowledgements xiv
About the Author xv
1 Basics and Introduction to C ............................................................... 2
1.1 Why to Use Computers? 3
1.2 Basics of a Computer 3
1.3 Latest Computers 5
1.4 Introduction to C 6
1.5 About ANSI C Standard 7
1.6 Machine, Assembly and High-Level Language 7
1.6.1 Assembly Language 8
1.6.2 High-Level Language 8
1.7 Assembler, Compiler and Interpreter 8
1.8 Structure of a C Program 10
1.9 Programming Rules 12
1.10 Executing the C Program 12
1.11 Standard Directories 16
1.12 The First C Program 16
1.13 Advantages of C 17
1.14 Header Files 17
1.15 Algorithm 18
1.15.1 Program Design 20
1.16 Classification of Algorithms 21
1.17 Flowcharts 22
1.18 Pseudocode 26
Summary 28
Exercises 28
2 The C Declarations ............................................................................. 32
2.1 Introduction 33
2.2 The C Character Set 33
2.3 Delimiters 34
A01_KAMT3553_02_SE_FM.indd 3 5/17/2015 8:59:36 AM