Preface
The world today is witnessing a new kind of revolution—the Information Revolution—ushered in
by technology. This revolution is far more sweeping than any other revolution in history in its reach
and influence, bringing fundamental changes in all aspects of our life. Information technology
(IT) is the engine used to drive useful information systems. This includes computers, software,
and the Internet/intranet and telecommunication systems. IT provides the means for collecting,
storing, encoding, processing, analyzing, transmitting, receiving and printing text, audio or video
information.
C is one of the famous and important programming languages because of its qualities. Its syntax
looks like general English language, and hence, it is simple and easy to learn. Besides, it is built with
abundant features by the developer, which is presented in the book. In India and worldwide, most of the
skilled people use C as a programming language.
Almost all boards of examinations, universities and Government of India have recognized the impor-
tance of software and its impact on economy. Most of universities, boards, and training institutes have
included C language in the curricula. It is expected to learn the basics of a language, develop programming
skills and acquire expertise to develop software packages and applications.
Keeping pace with these trends and to meet the requirements of modern curricula, all universities
have integrated the study of computer fundamentals and C programming in B.Tech., MCA, MBA, BCA
and B.Sc. courses. The book in your hand, Computer Fundamentals and Programming, in its unique
easy-to-understand question-and-answer format directly addresses the need of students enrolled in these
courses.
The questions and corresponding answers in this book have been designed and selected to cover all
the fundamentals that one must learn in order to pursue virtually any endeavor in the IT field.
Numerous multiple-choice questions, programs and their outputs, and questions to identify the bugs
in the C programs, etc., have been designed and selected that cater the need of students to solve the
examination papers and face the C aptitude test in campus interviews. The reader/programmer may lead
a successful career in the development of application software packages after thoroughly reading the
book and implementing the programs.
The organized and accessible format allows the students to quickly find the questions on specific
topics. In simple words, reading this book will benefit anyone who wishes to arm themselves with
substantive computer and programming skills.
Computer Fundamentals and Programming is a part of a series named Express Learning Series,
which has a number of books designed as quick reference guides to important undergraduate and
postgraduate courses.
A01_ITL-ESL4791_01_SE_PREL.indd ixA01_ITL-ESL4791_01_SE_PREL.indd ix 12/24/2012 4:51:47 PM12/24/2012 4:51:47 PM
Unique Features
1. Designed as a student-friendly, self-learning guide, the book is written in a clear, concise and lucid
manner.
2. Easy-to-understand question-and-answer format.
3. Includes questions that have appeared in previous years’ question papers as well as new questions,
which have been organized in the relevant chapters.
4. All types of questions, including MCQs and brief and detailed questions, are covered.
5. Solutions to numerical questions and questions involving programming that have appeared in previ-
ous examinations are provided.
6. All ideas and concepts are presented with clear examples.
7. Text is well structured and well supported with suitable diagrams.
8. Inter-chapter dependencies are kept to a minimum.
9. A comprehensive index is given at the end of the book for quick access to desired topics.
Chapter Organization
The book is divided into two parts, with Part I titled Computer Fundamentals and Part II titled as
Programming Concepts.
Part I: Computer Fundamentals
All the questions–answers are organized into six chapters. A brief discussion of these chapters is as
follows:
Chapter 1 provides an overview of the history of computers and the basic digital computer con-
cepts. It describes how computations are carried out using arithmetic and logic units, registers and
the control unit. In addition, it introduces the reader to the various types of memory devices and the
input and output devices.
Chapter 2 discusses about number systems and conversion between different number systems.
Chapter 3 provides an outlook on operating systems along with their types and functions.
Chapter 4 describes the fundamentals of computer software and its relationship with the hardware
in building up a fully functional computer system. It also deals with programming and various
programming tools such as algorithm, flowchart and pseudocode.
Chapter 5 provides a foundation to harness the power of word processing, spreadsheet programs and
creating presentations using Microsoft Office Word, Excel and PowerPoint 2003, respectively.
Chapter 6 deals with data communication and computer network along with important concepts like
transmission modes, network topologies and the OSI and the TCP/IP reference models. It also introduces
the reader to the different Internet tools such as browsing, searching and sending and receiving e-mails.
Part II: Programming Concepts
All the questions–answers are organized into 15 chapters. A brief discussion of these chapters is as
follows:
Chapter 1 unfolds the basics of computer and introduction to C. This chapter introduces the reader
to the fundamentals of a computer and introductory information on C language is provided. The
x
Preface
A01_ITL-ESL4791_01_SE_PREL.indd xA01_ITL-ESL4791_01_SE_PREL.indd x 12/24/2012 4:51:47 PM12/24/2012 4:51:47 PM
Preface xi
topics covered are parts of a computer system, features of C language, rules for writing a program,
methods to edit and run the programs with Turbo C compiler, etc.
Chapter 2 deals with C declaration. It focuses on C data types, differences between signed and
unsigned data types, variables, constants, C keywords, type conversion, dynamic initialization, etc.
Chapter 3 explains various C operators and their priorities. This chapter presents arithmetic, rela-
tional, and logical operators. It also embodies increment, decrement (unary operators) and assign-
ment operators. Other operators such as comma, conditional operators and bitwise operators are
presented in this chapter. Precedence of operators and associativity rule are also explained.
Chapter 4 enlightens the readers with formatted input and output functions such as scanf() and
printf() functions. The unformatted functions such as putchar(), getche(), gets(),
etc., are described in this chapter. The special symbols such as escape sequences together with their
applications have also been discussed.
Chapter 5 covers the decision-making statements supported by C language. This chapter details
how the control can be transferred from one part of the program to other part. The programmer can
make the program powerful by using control statements such as if, if-else, nested if-else
statements and switch case. To change the flow of the program, the programmer can use key-
words such as break, continue and goto.
Chapter 6 discusses control loop structures that explain ‘how’ statements are executed several
times until a condition is satisfied. In this chapter, the reader follows program loop structures,
which is also known as iterative or repetitive structure. Three types of loop control statements are
illustrated, with programming examples. They are for, while and do-while loop statements.
Syntaxes of these control statements are briefed.
Chapter 7 covers one-dimensional, two-dimensional and multidimensional arrays. It deals with
both integer and character arrays. A description on accessing and displaying array elements on
the screen is presented in this chapter. Various operations on an array that can be performed are
described in this chapter.
Chapter 8 focusses on strings. This chapter teaches the reader how to declare and initialize a string.
The various formats for displaying the strings are described through numerous examples. String
handling has a strong impact in real-life string problems such as conversion of lower to upper case,
reversing, concatenation, comparing, searching and replacing of string elements. Methods of per-
forming these operations with and without standard library functions are also explained.
Chapter 9 deals with the most important feature of the C language, i.e. pointers. This chapter
is important but is difficult to understand easily. Through examples, the reader is made famil-
iar with pointers. The reader is enlightened about declaration and initialization of pointers. The
learner studies how to access variables using pointers. How pointers are used to allocate memory
dynamically at run time is illustrated using memory allocation functions such as malloc()
and calloc() functions. How memory is handled efficiently with pointers is explained in this
chapter. This chapter consists of arithmetic operations on pointers, pointers and arrays, pointers to
pointers, etc.
Chapter 10 is one of the important chapters on functions. After reading this chapter, a reader will
learn how a large-sized program is divided into smaller ones and how a modular program should be
developed. A programmer learns the definition and declaration of a function. In this chapter, topics
such as return statements, types of functions, functions with passing arguments, etc., are described
in detail. “Call by value” and “call by reference” and the answers are given with many program-
ming examples. The recursive nature of function is also described. Direct and indirect recursive
functions have been explained clearly.
A01_ITL-ESL4791_01_SE_PREL.indd xiA01_ITL-ESL4791_01_SE_PREL.indd xi 12/24/2012 4:51:47 PM12/24/2012 4:51:47 PM
xii Preface
Chapter 11 enlightens the reader on the variables used in C in different situations. It covers
topics such as types of variables, local variables and global variables. The various storage classes
of a variable are included in this chapter. Also, explanation on auto, extern, static, and
register variables are presented in this chapter.
Chapter 12 describes how to make use of preprocessor directives. This chapter also discusses how
various macros are to be used. This chapter enlightens preprocessor directives such as #define,
#undef, #include, #line, token pasting and stringizing operations, conditional
compilation, etc., through C and illustrations are provided for the ease of the reader. By reading
this chapter, the reader learns how to display a programmer’s own error messages using #error
directive, and by making various warnings, on/off is displayed by the compiler using the #pragma
directive. The reader is also exposed to predefined macros in ctype.h in this chapter.
Chapter 13 discusses structures and unions. This is another powerful chapter of C language. One
can get derived data type using structures and unions. The user can decide the heterogeneous data
types to be included in the body of a structure. Use of dot operator (.) and pointer (-
) are explained
in this chapter for accessing members of structure. Declaration and initialization of structure and
union can be learnt from this chapter. The typedef facility can be used for creating user-defined
data types and this is illustrated with many examples. Enumerated data type, union, etc., are the
important subtitles of this chapter. Enumerated data type provides user-defined data types. Union
is a principal method by which the programmer can derive dissimilar data types. Last but not the
least, the DOS and ROM-BIOS functions and their applications are explained.
Chapter 14 is on files. This chapter explains the procedure for opening a file, storing information
in it and reading it. How to read a file, how to append information in it, etc., are explained in this
chapter. Many file-handling commands are discussed in this chapter. Text and binary files are dis-
cussed in this chapter. Command line arguments to accept arguments from command prompt are
described. Simulation of various DOS commands with examples is also provided. The reader is
also made familiar with I/O redirections in which MSDOS redirects to send the result to the disk
instead of seeing information on the monitor.
Chapter 15 deals with graphics. How to draw various figures/images using C library graphics
functions can be studied from graphics chapter. This chapter enlightens the reader about the initial-
ization of graphics with library graphics functions and a number of programming examples.
Ashok N. Kamthane
Rohit Khurana
A01_ITL-ESL4791_01_SE_PREL.indd xiiA01_ITL-ESL4791_01_SE_PREL.indd xii 12/24/2012 4:51:47 PM12/24/2012 4:51:47 PM
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset