Programming for Problem Solving E Balagurusamy - The full ebook set is available with all chapters for download
Programming for Problem Solving E Balagurusamy - The full ebook set is available with all chapters for download
https://ebookmass.com/product/problem-solving-and-python-programming-
e-balagurusamy/
https://ebookmass.com/product/computer-programming-e-balagurusamy/
Programming in C E. Balagurusamy
https://ebookmass.com/product/programming-in-c-e-balagurusamy/
https://ebookmass.com/product/programming-in-ansi-c-6th-edition-e-
balagurusamy/
Programming and Problem Solving with Python Ashok Namdev
Kamthane
https://ebookmass.com/product/programming-and-problem-solving-with-
python-ashok-namdev-kamthane/
https://ebookmass.com/product/python-programming-using-problem-
solving-approach-1st-edition-reema-thareja/
https://ebookmass.com/product/introduction-to-programming-with-java-a-
problem-solving-approach-3rd-edition-john-dean/
https://ebookmass.com/product/matlab-a-practical-introduction-to-
programming-and-problem-solving-4th-edition-stormy-attaway/
https://ebookmass.com/product/data-structures-e-balagurusamy/
PROGRAMMING
fOR
PRObleM SOlvING
Gujarat Technological University - 2018
About the Author
E Balagurusamy, is presently the Chairman of EBG Foundation, Coimbatore. In the past he has also held
the positions of member, Union Public Service Commission, New Delhi and Vice-Chancellor, Anna University,
Chennai. He is a teacher, trainer and consultant in the fields of Information Technology and Management.
He holds an ME (Hons) in Electrical Engineering and PhD in Systems Engineering from the Indian Institute
of Technology, Roorkee. His areas of interest include Object-Oriented Software Engineering, E-Governance:
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.
A recipient of numerous honors and awards, he has been listed in the Directory of Who's Who of Intellectuals
and in the Directory of Distinguished Leaders in Education.
PROGRAMMING
fOR
PRObleM SOlvING
Gujarat Technological University - 2018
E Balagurusamy
Chairman
EBG Foundation
Coimbatore
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 The Composers, 260, C.A. Apartment, Paschim Vihar, New Delhi 110 063 and printed at
Cover Printer:
Cover Designer: APS Compugraphics
Cover Image Source: Shutterstock
Visit us at: www.mheducation.co.in
Write to us at: [email protected]
CIN: U22200TN1970PTC111531
Toll Free Number: 1800 103 5875
Preface
P
rogramming for Problem Solving requires a deep understanding of C. C is 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 used general-purpose language today in operating systems, and embedded
system development. Its influence is evident in almost all modern programming languages. Since its
standardization in 1989, C has undergone a series of changes and improvements in order to enhance the
usefulness of the language.
Acknowledgements
I owe special thanks to the entire team of McGraw Hill Education India.
A note of acknowledgement is due to the following reviewers for their valuable feedback.
This book is my sincere attempt to make a footprint on the immensely vast and infinite sands of knowledge.
I would request the readers to utilize this book to the maximum extent.
E Balagurusamy
Publisher’s Note
McGraw Hill Education (India) invites suggestions and comments from you, all of which can be sent to info.
[email protected] (kindly mention the title and author name in the subject line).
Piracy-related issues may also be reported.
Contents
Translator Programs 58
Problem-Solving Techniques 59
Using the Computer 70
Learning Outcomes 70
Key Concepts 71
Review Questions 73
Discussion Questions 84
2. Fundamentals of C 87
Learning Objectives 87
History of C 87
Importance of C 89
Sample Program 1: Printing a Message 89
Sample Program 2: Adding Two Numbers 92
Sample Program 3: Interest Calculation 93
Sample Program 4: Use of Subroutines 95
Sample Program 5: Use of Math Functions 96
Basic Structure of C Programs 97
Programming Style 98
Executing a ‘C’ Program 99
UNIX System 99
MS-DOS System 102
Key Concepts 102
Always Remember 103
Review Questions 103
Debugging Exercises 105
Programming Exercises 105
5. Functions 220
Learning Objectives 220
Introduction 220
Need for User-Defined Functions 221
A Multi-Function Program 221
Elements of User-Defined Functions 224
x Contents
6. Pointers 273
Learning Objectives 273
Introduction 273
Understanding Pointers 274
Accessing the Address of a Variable 276
Declaring Pointer Variables 277
Initialization of Pointer Variables 278
Accessing a Variable Through its Pointer 279
Chain of Pointers 281
Pointer Expressions 282
Pointer Increments and Scale Factor 284
Pointers and Arrays 284
Pointers and Character Strings 288
Array of Pointers 290
Pointers as Function Arguments 291
Functions Returning Pointers 294
Visit https://ebookmass.com today to explore
a vast collection of ebooks across various
genres, available in popular formats like
PDF, EPUB, and MOBI, fully compatible with
all devices. Enjoy a seamless reading
experience and effortlessly download high-
quality materials in just a few simple steps.
Plus, don’t miss out on exciting offers that
let you access a wealth of knowledge at the
best prices!
Contents xi
7. Structure 311
Learning Objectives 311
Introduction 311
Defining a Structure 312
Declaring Structure Variables 313
Accessing Structure Members 315
Structure Initialization 316
Copying and Comparing Structure Variables 318
Operations on Individual Members 320
Arrays of Structures 320
Arrays within Structures 323
Structures within Structures 324
Structures and Functions 326
Unions 329
Size of Structures 330
Bit Fields 330
Key Concepts 333
Always Remember 333
Brief Cases 334
Review Questions 338
Debugging Exercises 341
Programming Exercises 341
Introduction to computer and programming: Introduction, Basic block diagram and functions of various
components of computer, Concepts of Hardware and software, Types of software, Compiler and interpreter,
Concepts of Machine level, Assembly level and high level programming, Flowcharts and Algorithms
Fundamentals of C: Features of C language, structure of C Program, comments, header files, data types,
constants and variables, operators, expressions, evaluation of expressions, type conversion, precedence
and associativity, I/O functions
GO TO Chapter 2 Fundamentals of C
Control structure in C: Simple statements, Decision making statements, Looping statements, Nesting of
control structures, break and continue, goto statement
Array & String: Concepts of array, one and two dimensional arrays, declaration and initialization of arrays,
string, string storage, Built-in-string functions
Recursion: Recursion, as a different way of solving problems. Example programs, such as Finding
Factorial, Fibonacci series, Ackerman function etc. Quick sort or Merge sort.
Functions: Concepts of user defined functions, prototypes, definition of function, parameters, parameter
passing, calling a function, recursive function, Macros, Pre-processing
GO TO Chapter 5 Functions
Pointers: Basics of pointers, pointer to pointer, pointer and array, pointer to array, array to pointer, function
returning pointer
GO TO Chapter 6 Pointers
Structure: Basics of structure, structure members, accessing structure members, nested structures, array
of structures, structure and functions, structures and pointers
GO TO Chapter 7 Structure
introduction
A computer is an electronic machine that takes input from the user, processes the given input and generates
output in the form of useful information. A computer accepts input in different forms such as data, programs
and user reply. Data refer to the raw details that need to be processed to generate some useful information.
Programs refer to the set of instructions that can be executed by the computer in sequential or non-
sequential manner. User reply is the input provided by the user in response to a question asked by the
computer.
A computer includes various devices that function as an integrated system to perform several tasks
described above (Fig. 1.1). These devices are:
Central Processing Unit (CPU)
It is the processor of the computer that is responsible for controlling and executing instructions in the computer.
It is considered as the most significant component of the computer.
2 Programming for Problem Solving
Monitor
It is a screen, which displays information in visual form, after receiving the video signals from the computer.
Keyboard and Mouse
These are the devices, which are used by the computer, for receiving input from the user.
Computers store and process numbers, letters and words that are often referred to as data.
l How do we communicate data to computers?
l How do the computers store and process data?
Since the computers cannot understand the Arabic numerals or the English alphabets, we should use
some ‘codes’ that can be easily understood by them.
In all modern computers, storage and processing units are made of a set of silicon chips, each contain-
ing a large number of transistors. A transistor is a two-state device that can be put ‘off’ and ‘on’ by passing
an electric current through it. Since the transistors are sensitive to currents and act like switches, we can
communicate with the computers using electric signals, which are represented as a series of ‘pulse’ and
‘no-pulse’ conditions. For the sake of convenience and ease of use, a pulse is represented by the code ‘1’
and a no-pulse by the code ‘0’. They are called bits, an abbreviation of ‘binary digits’. A series of 1s and
0s are used to represent a number or a character and thus they provide a way for humans and computers
to communicate with one another. This idea was suggested by John Von Neumann in 1946. The numbers
represented by binary digits are known as binary numbers. Computers not only store numbers but also
perform operations on them in binary form.
In this chapter, we discuss how the numbers are represented using what are known as binary codes, how
computers perform arithmetic operations using the binary representation, how digital circuits known as logic
gates are used to manipulate data, how instructions are designed using what are known as programming
languages and how algorithms and flow charts might help us in developing programs.
generations of computers
The history of computer development is often discussed in terms of different LO 1.1
generation of computers, as listed below. Identify the various
l First generation computers generations
l Second generation computers of computers
l Third generation computers
l Fourth generation computers
l Fifth generation computers
Introduction to Computer and Programming 3
The progress in LSI and VLSI technologies led to the development of microprocessor, which became the
major characteristic feature of the fourth generation
computers. The LSI and VLSI technology allowed
thousands of transistors to be fitted onto one small silicon
chip.
A microprocessor incorporates various components
of a computer—such as CPU, memory and Input/Output
(I/O) controls—onto a single chip. Some popular later
microprocessors include Intel 386, Intel 486 and Pentium.
Some of the examples of fourth generation computers
are IBM PC, IBM PC/AT, Apple and CRAY-1.
Advantages
l LSI and VLSI technologies made them small,
cheap, compact and powerful.
l high storage capacity
l highly reliable and required very less maintenance. Fig. 1.5 The Intel P4004 microprocessor chip
Introduction to Computer and Programming 5
l provided a user-friendly environment with the development of GUIs and interactive I/O devices.
l programs written on these computers were highly portable because of the use of high-level languages.
l very versatile and suitable for every type of applications.
l required very less power to operate.
Disadvantages
l the soldering of LSI and VLSI chips on the wiring board was complicated
l still dependent on the instructions given by the programmer.
Fifth generation computers are based on the Ultra Large Scale Integration (ULSI) technology that allows
almost ten million electronic components to be fabricated on one small chip.
Advantages
l faster, cheaper and most efficient computers till date.
l They are able to execute a large number of applications at the same time and that too at a very high
speed.
l The use of ULSI technology helps in decreasing the size of these computers to a large extent.
l very comfortable to use because of the several additional multimedia features.
l versatile for communications and resource sharing.
Disadvantage
They are not provided with an intelligent program that could guide them in performing different operations.
Figure 1.6 shows a tree of computer family that illustrates the area-wise developments during the last
four decades and their contributions to the various generations of computers.
classification of computers
Computers can be classified into several categories depending on their LO 1.2
computing ability and processing speed. These include Classify computers on
l Microcomputer the basis of different
l Minicomputer criteria
l Mainframe computers
l Supercomputers
Microcomputers
A microcomputer is defined as a computer that has a microprocessor as its CPU and can perform the
following basic operations:
l Inputting — entering data and instructions into the microcomputer system.
l Storing — saving data and instructions in the memory of the microcomputer system, so that they can
be use whenever required.
l Processing — performing arithmetic or logical operations on data, where data, such as addition,
subtraction, multiplication and division.
l Outputting — It provides the results to the user, which could be in the form of visual display and/or
printed reports.
l Controlling — It helps in directing the sequence and manner in which all the above operations are
performed.
Minicomputers
A minicomputer is a medium-sized computer that is more powerful than a microcomputer. It is usually
designed to serve multiple users simultaneously, hence called a multiterminal, time-sharing system.
6 Programming for Problem Solving
Margaret raised herself like one who has been nearly drowned and
still catches for breath, gathered her benumbed faculties and
recollected where she was. All was quiet within the house; and
without there was stillness of another sort, a silence that was living
and aware, a sense as of thousands waking and watching. Now
and then there came from the hospital across the street some voice
of a sleepless sufferer, the long, low moan of almost exhausted
endurance, the broken cry of delirium, or the hoarse gasp of
pneumonia.
Margaret went to her window and leaned out. The sultry air was
heavily-laden with fragrance from the flower-gardens around, and
in the sky the large stars trembled like over-full drops of a golden
shower descending through the ambient purple dusk.
The watcher's heart sent out a cry: "O Father in heaven! see how
thy creatures suffer."
When, long after sunrise, Mrs. Black entered her visitor's chamber,
she found Margaret kneeling by the window, fast asleep, with her
head resting on the sill.
Mrs. Black told all this with such an air of satisfaction in the midst
of her terror that Margaret made some allowance for embellishment
in the story. Evidently the good woman enjoyed a panic, and was
willing to be frightened to the very verge of endurance for the sake
of having it to tell of afterward. She went about in a sort of
delighted agony, gathering up her spoons and forks, and giving
little shrieks at the least unusual sound.
"If they should bombard the city, my dear," she said, "we can go
down cellar. I have an excellent cellar. It is almost certain that they
will come. We must be in a strait when the treasury-clerks come
out. And such a sight! They passed here just before I went up to
call you, all in their shirt-sleeves, and looking no more like soldiers,
dear, than I do this minute. Half of them carried their rifles over the
wrong shoulder, and seemed scared to death lest they should go
off. And no wonder; for the way the barrels slanted was enough to
make you smile, even if there were a bomb-shell whizzing past
your nose. The muzzles looked all ways for Sunday, so to speak.
There were little boys with them, too. I don't see where their pas
and mas were, if they've got any. It's a sin and shame. Do eat
some more breakfast, pray! You may as well have a full stomach;
for if we should be obliged to hide in the cellar, we might not dare
come up to get a mouthful for twenty-four hours. I do hope it
won't be a long siege. If they've got to come in, let'em come. I'm
sure they would be too much of gentlemen to molest a houseful of
defenceless females. As for poor Mr. Black, he doesn't count.
Though he is my husband, I have seen braver men, not to speak of
women. I had to threaten him, this morning, within an inch of his
life, to prevent him from running a Confederate flag out of the
window. He keeps one in his trunk, in case it should be needed. He
declared he heard firing in the avenue. Bless me! What is that?"
"One of the servants has broken a dish."
"The destructive minxes! But where are you going, dear? Over to
the hospital? Oh! they don't admit visitors on Sunday. Even on
week-days you can't get in till after the surgeons have gone their
rounds, and that is never before ten o'clock. It is military rule, you
know; as regular as clock-work. It won't come ten till sixty minutes
after nine o'clock, not if you perish. The first time I went in there,
the soldier on guard came near running me through with his
bayonet, just because I didn't walk in a certain particular road. I
tried to reason with him; but you might as well reason with stocks
and stones. There was the man in the middle of the road, and
there was the point of his bayonet within an inch of my stomacher;
and the upshot of the matter was, that I had to turn about and
walk in a straight road instead of a curved one, for no earthly
reason that I could see. You really cannot get in to-day. Wait till to-
morrow, and I will go over with you."
"Mrs. Black," she said, "did you ever hear of the man who said that
whenever he saw 'Positively no admittance' posted up anywhere, he
always went in there directly?"
"Well," the lady sighed, "I can't say but you may get in. You are
your grandfather's granddaughter, and he never said fail. Only, be
sure you look your best. You remember the song your mother used
to sing about the chief who offered a boatman a silver pound to
row him and his bride across the stormy ferry; and the Highland
laddie said he would, not for the 'siller bright,' but for the 'winsome
lady.' Many's the time I cried to hear your poor mother sing that,
and how they all perished in the storm, and the father they were
running away from stood on the shore lamenting. Your grandfather
would wipe his eyes on the sly, and wait till she had finished every
word of it; and then he would speak up and say that she had
better be singing the praises of God. May be the officers over there
will be like the Highland boatman, and do for you what they would
n't do for an ugly old woman like me."
Margaret closed her ears to that piercing sentence, "the song your
mother used to sing "—O silent lips!—and going out, crossed over
to the hospital.
The smaller the warrior, the greater the martinet. Doubtless this
young man regarded his present adversary with far more fierceness
than he would have shown toward a six-foot Texan grey coat, with
a belt bristling with armor, and two eyes like two blades.
"I haven't any," she said pitifully, and looked with appealing eyes at
an officer just inside the door.
She told her errand briefly, and handed him the letters she had
brought.
Mrs. Black had not overrated the power of the winsome lady. The
surgeon in charge, for this was he, merely glanced over the letters
to learn the bearer's name and State. He had already found her
face, voice, and gloves such as should, in his opinion, be admitted
anywhere and at all times.
She thanked him again, and went up the hall, utterly unconscious
that she had been greatly honored.
The hall was very long, so long that the door at the furthest end
looked as though only a child could go through without stooping,
and the wards were built out to right and left. She visited every
one, walking up and down the rows of beds, her eager glance
flashing from face to face. There was no face there that she had
ever seen before. With a faint voice she asked for the names of
those who had lately died. The names were as strange as the
faces. Finally she sat down in one of the wards to rest.
The inside of the hospital was altogether less gloomy than the
outside had appeared. They were in a bustle of preparation for
inspection, putting clean white covers on the beds and the stands,
regulating the medicine-table and the book-shelves, squaring
everything, looking out that the convalescents were in trim, belt-
buckles polished, shoes bright, hair smooth, jackets buttoned up to
the chin.
The ward looked fresh and cheerful. The white walls were
festooned with evergreen, green curtains shaded the windows, and
the floor was as white as a daily scouring could make it. Nearly half
of the patients were dressed, and eagerly talking over the news;
and even the sickest there looked on with interest, and brightened
occasionally.
"It isn't my fault," Tom said pitifully to Miss Hamilton, who sat near
him. "When I went to bed here, five weeks ago, I wasn't any taller
than the ward-master; and now I believe I'm seven feet long. I
believe it was that everlasting quinine!" And poor Tom burst into
tears.
Instantly all was silence. Each convalescent stood at the foot of his
bed, and the nurses were drawn up inside the door. The little
procession of surgeons appeared, marched up one side of the ward
and down the other, and out the door; and the inspection was over.
"Who was that last surgeon in the line?" she asked of Tom.
An orderly came to the door. "Every man who is able to carry a rifle
get ready to go down to Camp Distribution," he said. "Don't let any
of 'em shirk, Linn. Send some of those fellows down to the office to
be examined. Every man is wanted."
As Margaret went out, she saw Surgeon A—— hasten from one of
the wards, and look along the floor of the hall, as if in search of
something. His face was very pale, she saw, and he looked up
sharply at her as she approached him.
"Perhaps you miss this photograph, Col. A——," she said, offering it
to him.
His face reddened violently as he took it. "Has any one seen it
besides you, madam?" he asked.
"No one."
"By no means," she replied coldly. "I do not wish to hear any
explanation. I am here on business of my own, and shall not,
probably, take any further notice of what I have seen. But if on
second thought I should consider myself obliged to mention it, you
can make your explanation to Mr. Lincoln."
She left him at that, and went home to hear Mrs. Black's
compliments on her success.
There were no more visits that day; but the next morning a close
carriage was sent to the door, and Margaret began her rounds.
For the first time she looked on what she had done as the world
might look upon it—as Mr. Granger himself might look upon it.
Friends or foes, he was a gentleman, and she a lady, and not a
baby. She, wandering from place to place, unbidden, in search of
him, weeping, praying, making a fool of herself, she thought
bitterly, and he sitting his horse there gallantly, safe and merry,
within reach of her hand, showing his white teeth in a laugh,
stroking down his beard with that gesture she knew so well, taking
off his hat to shake the raindrops from it, and loop up the aigrette
at the side!
She had time to remember with a pang of envy the quiet, guarded
women who sit at home, and take no step without first thinking
what the world will say of it.
But still, with her veil drawn close, she looked at him steadily; for,
after all, he was going into battle, and he was her friend. As she
looked, he glanced up at one of the hospital windows, and
immediately his glance became an earnest gaze. He ceased
speaking, and his face showed surprise and perplexity.
"I beg your pardon, madam!" he said at once, taking off his hat to
the veiled lady he saw there.
He rode slowly on, looking back once more to the hospital window,
and in a few minutes was out of sight.
Margaret started.
"Why, yes."
She went in and seated herself in the hall. "I want to rest," she
said to a soldier who stood there. "I don't feel quite well."
A slight, elderly lady in a black dress, and with her bonnet a little
awry, came down the stairs, and stood looking about as though she
expected some one.
"Can you tell me where Miss Blank is to be found?" she asked of
the soldier to whom Margaret had spoken. "She has been out in
the tent wards, and there she comes," he said, nodding toward a
young woman who came in at the door furthest from them, and,
with a face expressive of apprehension, approached the waiting
lady.
"Yes," was the reply. "You will be ready to return home to-morrow,
or as soon as communication is reestablished. I will send your
transportation papers to-night. You need not go into the wards
again."
"Yes," he replied. "She makes short work of it. That is one of the
best nurses, and the best dresser in the hospital."
"Miss Dix has probably heard something about her. She's a good
young woman, but the old lady is mighty particular."
Margaret rose to meet Miss Dix as she came along the hall.
"Who are you?" asked the lady. Margaret presented her credentials,
and Miss Dix glanced them over, then looked sharply at their owner.
"You will be very careful who you speak to," the lady began; "you
will dress in the plainest possible manner, wear no ornaments, and,
of course, high necks and long sleeves. Your hair—are those waves
natural?"
"Yes'm!" said Margaret humbly, and was about to add that perhaps
she could straighten them out, but checked herself.
"Well, dress your hair very snugly, wear clean collars, and don't let
your clothes drag. It looks untidy. Is that dress quite plain?"
Margaret threw back the thin mantle she wore, and showed a gray
dress of nunlike plainness.
Here they turned into the square, and got out at the door of the
hospital Margaret had visited the day before. She was introduced to
the officer of the day, received an astonished bow from the
surgeon-in-charge in passing, caught a glimpse of Doctor A——,
and was escorted to her ward.
"I'm proper glad," said Tom, with an ecstatic grin. "I liked the looks
of you when I saw you yesterday."
Chapter XIV.
Moreover, Miss Hamilton would sleep and take her meals at Mrs.
Black's, which was another palliating circumstance.
Mr. Lewis, with a fund of gibes ready, came also to see the new
nurse. But the sight of her silenced him.
She accompanied him to the door. "If you should see Mr. Granger,
or write to him," she said, with some confusion, "don't mention
why I came here. I am ashamed of it."
"Oh! you needn't feel so," he replied soothingly. "We have had a
nice little adventure to pay us for the journey; and you were
breaking your heart with inaction and anxiety."
"Women should break their hearts at home!" she said proudly, her
cheeks glowing scarlet.
O God! The blow had fallen! No need even to look into his white
and smileless face to know that.
He stopped, and spoke through the open window. "Come,
Margaret!"
Morning, was it? Morning! She could hardly see to reach the
carriage, and the earth seemed to be heaving under her feet.
As they drove through that strange, feverish world that the sunny
summer day had all at once turned into, she heard a long, heavy
breath that was almost a groan. "O dear!" said Mr. Lewis.
She reached out her hand to him, as one reaches out in the dark
for support. "Tell me!"
"It is a wound in the head," he said; "and any wound there is bad.
I got the dispatch at Baltimore last night, and came right back.
They forwarded it from Boston. Why did not you tell me that you
saw him Monday?"
"Saw him!"
"Then you didn't know him?" Mr. Lewis said. "I thought it strange
you shouldn't mention it. Louis says that when they were going out
past Columbia College, he glanced up at one of the windows, and
saw you leaning out and looking at him. You were very sober, and
made no motion to speak; and after a moment your face seemed
to fade away. It made such an impression on him that he asked to
be carried there and to that room, though it isn't an officers'
hospital. He was almost superstitious about it, till I told him that
you were really here."
It was true then. The intensity of her gaze, and the concentration
of her thoughts upon him at that moment had by some mystery of
nature which we cannot explain, though guesses have been many,
impressed her image on his mind, and thrown the reflection of it
through his eyes, so that where his glance chanced to fall at that
instant, there she had seemed to be.
"You must try to control yourself, Margie," Mr. Lewis went on, his
own lip trembling. "There is danger of delirium. He is afraid of it,
and watches every word he says. He can't talk much. I'll give you a
chance to say all you want to; and whenever I'm needed, you can
call me. I will wait just outside the door. Give your bonnet and
shawl to the lady. There, this is his room, and that is yours, just
across the entry."
The pleasant chamber was clean, cool, and full of a soft flicker of
light and shade from trees and vines outside. On a narrow, white
bed opposite the windows lay Mr. Granger. Could it be that he was
ill? His eyes were bright, and his face flushed as if with health. The
only sign of hurt was a little square of wet cloth that lay on the top
of his head. But in health, in anything short of deadly peril, he
would have smiled on seeing her after so long a time, and when
she stood in such need of reassuring. His only welcome was an
outstretched hand, and a fixed, earnest gaze.
She seated herself by the bedside. "I have come to help take care
of you, Mr. Granger." Then smiling, faintly, "You don't look very
sick."
"I was in high health before I got this," he said, motioning toward
his head.
The room swam round before her eyes a moment, but she kept her
seat.
Presently the surgeon came in, and she gave place to him. But as
he removed the cloth from his patient's head, she bent
involuntarily, with the fascination of terror, and looked, and at the
sight, dropped back into her chair again. She had looked upon
nature in her inmost mysterious workshop, to which only death can
open the door. It was almost like having committed a sacrilege.
Mr. Lewis wet a handkerchief with cologne, and put it into her
hand. The others had not noticed her agitation.
When the surgeon left the room, he beckoned Margaret out with
him. "All that you can do is, to keep his head cool," he said. "Don't
let him get excited, or talk much without resting. He has kept
wonderfully calm so far; but it is by pure force of will. I never saw
more resolution."
There was nothing to do, then, but to sit and wait; to make him
feel that he was surrounded by loving care, and to let no sign of
grief disturb his quiet.
She returned to the room, and Mr. Lewis, after bending to hold the
sick man's hand one moment in a silent clasp, went out and left
them together.
After a little while, when she had resumed her seat by him, Mr.
Granger spoke, always in that suppressed voice that told what a
strain there was on every nerve. "I should have asked you to marry
me, Margaret, if I had gone back safe," he said, looking at her with
a wistful, troubled gaze, as if he wished to say more, but could not
trust himself.
"No matter about that now," she replied gently. "You have been a
good friend to me, and that is all I ever wanted."
"We could be married here, if you are willing," he went on. "Mr.
Lewis will see to everything."
Margaret lightly smoothed his feverish hands. "No," she said, "I do
not wish it. I didn't come for that. We are friends; no more. Let me
wet the cloth on your head now. It is nearly dry."
He closed his eyes, and made no answer. If he guessed confusedly
that his proposal, and what it implied, so made, was little less than
an insult, it was out of his power to help it then. And if for a breath
Margaret felt that all her obligations to him were cancelled, and
that she could not even call him friend again, it was but for a
breath. His case was too pitiful for anger. She could forgive him
anything now.
"I shall always stay with Dora, if you wish it," she said softly. "Do
not have any fears for her. I will be faithful. Trust me. I could
gladly do it for her sake, for I never loved any other child so much.
But still more, I will take care of her for yours."
Margaret could not trust herself to thank him for this proof of his
care for her.
"Have you seen the chaplain?" she asked, to turn the subject.
"Yes; but I don't feel like seeing him again. He does me no good,
and his voice confuses me. You are all the minister I need"—smiling
faintly—"and yours is the only voice I can bear."
While he rested, she sat and studied how indeed she should
minister to him.
Mr. Granger had never been baptized; and, though nominally what
is called an orthodox Congregationalist, he held their doctrines but
loosely. He had that abstract religious feeling which is the heritage
of all noble natures, the outlines of Christianity even before
Christianity is adopted, as Madame Swetchine says; but his
experience of pietists had not been such as to tempt him to join
their number. If a man lived a moral life, were kind, just, and pure,
it was about all that could be required of him, he thought. Such a
life he had lived; and now, though he approached death solemnly,
it was with no perceptible tremor, and no painful sense of
contrition.
She watched him as he lay there, smitten down in the midst of his
life and of health. He was quiet, now, except that his hands never
ceased moving, tearing slowly in strips the delicate handkerchief he
found within his reach, pulling shreds from the palm-leaf fan that
lay on the bed, or picking at the blanket. It was the only sign of
agitation he showed. His face was deeply flushed, his breathing
heavy, and his teeth seemed to be set.
After waiting as long as she dared, she spoke to him. "Can I talk to
you a little, Mr. Granger, without disturbing you?" she asked.
She began, and without any useless words, explained to him the
fundamental doctrines of the church, original sin, the redemption,
the necessity and effects of baptism. What she said was clear,
simple, and condensed. A hundred times during the last two years
she had studied it over for just such need as this.
She changed the cloth on his head, laid the ice close to his burning
temples, and fanned him in silence a few minutes.
The words came with difficulty, and his brows contracted as if some
sudden pain shot through them.
"I am not careless of the future, dear," he said after a while. "I
know that it is awful, and uncertain; but it is also inevitable! It is
too late now for me to change. But I wish that you would pray for
me. Let me hear you. Pray your own way. I am not afraid of your
saints."
Margaret knelt beside the bed, and repeated the Our Father. He
listened reverently, and echoed the Amen. She repeated the Acts,
and there was no response this time; the Creed, and still there was
no answer. She could not rise. In faltering tones she said the
Memorare, with the request, "Obtain for this friend of mine the gift
of faith, that though lost to me he may not be lost to himself."
Still he was silent. All the pent emotion of her soul was surging up,
and showing the joints in her mail of calmness. He was going out
into what was to him the great unknown, and she, with full
knowledge of the way, could not make him see it. One last, vain
effort of self-control, then she burst forth with a prayer half
drowned in tears.
"O merciful Christ! I cannot live upon the earth unless I know that
he is in heaven. Thou hast said, Knock, and it shall be opened unto
you. With my heart and my voice I knock at the door. Open to me
for thy word's sake! Thou hast said that whatever we ask in thy
name, we shall receive. I ask for faith, for heaven, for my friend
who is dying. Give them for thy word's sake! Thou hast said that
whoever does good to the least of thy children has done it unto
thee. Remember what this man has done for me. I was miserable,
and he comforted me. I was at the point of death, and he saved
me. I was hungry, and he fed me. I was a stranger, and he took
me in. Oh! look with pity on me, who in all my life have had only
one year of happiness, but many full of sorrow; see how my heart
is breaking, and hear me for thy word's sake! for thy word's sake!"
As her voice failed, a hand touched her head, and she heard Mr.
Granger's voice.
"I cannot make you distrust the truth of God," he said. "I do not
believe; but also, I do not know. I am willing to do all that he
requires. Perhaps he does require this. Such faith as yours must
mean something. Do as you will."
"May I send for a priest right away? And will you be baptized?"
"O Mr. Granger! God bless you! I am happy. Doesn't he keep his
promises? I will never distrust him again."
His grave looks did not dampen her joy. Of course it was not
necessary that he should have much feeling. The good intention
was enough. She wet his face with ice-water, laid ice to his head,
put the fan in his hand, in her childish, joyful way, shutting his
fingers about it one by one, then went out to send Mr. Lewis for a
priest.
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade
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.
ebookmass.com