Professional Documents
Culture Documents
INTRODUCTION
1.1. INTRODUCTION
Nowadays, computers are an integral part of our lives. They are used for the
reservation of tickets for airplanes and railways, payment of telephone and electricity bills,
deposit and withdrawal of money from banks, processing of business data, forecasting of
weather conditions, diagnosis of diseases, searching for information on the Internet, etc.
Computers are also used extensively in schools, universities, organizations, music industry,
The term computer is derived from the word compute. The word compute means
to calculate. Computer performs both simple and complex operations, with speed and
accuracy. Currently, computer literacy involves several aspects. A computer-literate
person knows how to make use of a computer in his or her field to make tasks easier and
to complete them more efficiently. Computer literacy involves knowledge of the Internet
and the World Wide Web and the ability to take advantage of their resources and to
critically judge the information.
Definition:
All computer systems perform the following five basic operations, for converting
raw input data into information:
Storage
Feedback
iii) Output: It is the process of producing useful information or results for the user,
such as a printed report or visual display.
iv) Storing: It the process of saving data and instructions to make them readily
available for initial or additional processing, as and when required.
v) Controlling: It is the process of directing the manner and sequence in which all of
the above operations are performed.
2
1.3. CHARACTERISTICS OF A COMPUTER
The computer has many special characteristics which justify its use. A computer can
be used for a variety of tasks including mathematical, logical, architectural and multimedia
applications. The important characteristics of computer are speed, accuracy, automatic,
endurance, versatility, storage, reduction in cost and no IQ.
i) Speed:
A computer is a very fast device. It can perform a task in few milliseconds better
than a human being can do in an entire year. The speed of a computer is measured in
million instructions per second (MIPS). The following are the measurements by which the
speed of a computer is measured.
ii) Accuracy:
In addition to being very fast, computers are very accurate. The accuracy of a
computer is consistently high and the degree of accuracy of a computer depends on its
design. Computer is based on the principle of Garbage-In-Garbage-Out (GIGO). It means
if wrong data is inputted then wrong output will be produced.
3
Example: The computer can accurately give the result o f division o f any two numbers up
to 10 decimal places.
iii) Automatic:
and find problems and solutions. We need to instruct a computer using coded
instructions that specify how it will do a particular job.
iv) Versatility:
A computer can be used to solve the problems related to various fields. It can
perform different types of tasks with the same ease. At one instance, it may be solving a
complex scientific problem and the very next moment it may be playing a card game.
v) Storage:
the stored data even after several years with same accuracy as the data fed. It can store
any type of data such as images, videos, text, audio and many others.
4
The use of computers for data processing in an organization leads to reduction in
paper work and results in speeding up a process. As data in electronic files can be
retrieved as and when required, the problem of maintenance of large number of paper
files gets reduced. Though the initial investment for installing a computer is high but it
substantially reduces the cost of each of its transaction.
vii) No IQ:
A computer has no intelligence on its own. It has to be told what to do and it what
sequence. Hence only the user can determine what tasks a computer will perform. A
computer cannot take its own decision.
Computers are used in so many fields in our daily life. From Engineers to Doctors,
Students, Teachers, and Government organizations they all use computer to perform
specific tasks, for entertainment or just to finish office work. With greater precision and
accuracy and less time taking computers can do a lot in short time whine doing manually.
Here the applications of computer in various fields are listed below:
i) Business:
Payroll calculations
Budgeting
Sales analysis
5
Financial forecasting
ii) Banking:
ATM machines are making it even easier for customers to deal with banks.
iii) Insurance:
Insurance companies are keeping all records up-to-date with the help of
computers. The insurance companies, finance houses and stock broking firms are widely
using computers for their concerns.
Insurance companies are maintaining a database of all clients with information showing
Maturity date
Bonus
iv) Education:
v) Marketing:
At Home Shopping - Home shopping has been made possible through use of
computerized catalogues that provide access to product information and
permit direct entry of orders to be filled by the customers.
Computers have become important part in hospitals, labs, and dispensaries. The
computers are being used in hospitals to keep the record of patients and medicines. It is
7
also used in scanning and diagnosing different diseases. ECG, EEG, Ultrasounds and CT
Scans etc., are also done by computerized machines.
Some major fields of health care in which computers are used are:
Diagnostic System - Computers are used to collect data and identify cause of
illness.
Lab-diagnostic System - All tests can be done and reports are prepared by
computer.
Patient Monitoring System - These are used to check patient's signs for
abnormality such as in Cardiac Arrest, ECG etc.
One of major areas is CAD (Computer aided design). That provides creation and
modification of images. Some fields are:
Structural Engineering - Requires stress and strain analysis for design of Ships,
Buildings, Budgets, Airplanes etc.
Computers are largely used in defence. Modern tanks, missiles, weapons etc.
Military also employs computerized control systems. Some military areas where a
computer has been used are:
Missile Control
Military Communication
Smart Weapons
ix) Communication:
Chatting
Usenet
FTP
Telnet
Video-conferencing
9
The period of first generation was 1946-1959. The computers of first generation
used vacuum tubes as the basic components for memory and circuitry for CPU (Central
Processing Unit). These tubes, like electric bulbs, produced a lot of heat and were prone
to frequent fusing of the installations, therefore, were very expensive and could be
afforded only by very large organizations. In this generation mainly batch processing
operating system were used. Punched cards, paper tape, and magnetic tape were used
as input and output devices. The computers in this generation used machine code as
programming language.
Features:
Unreliable
Supported machine language only
Very costly
Generated lot of heat
Non-portable
Consumed lot of electricity
Advantages:
10
Vacuum tube technology made possible the advent of electronic digital
computers.
Disadvantages:
less power, more compact in size, more reliable and faster than
the first generation machines made of vacuum tubes. In this generation, magnetic cores
were used as primary memory and magnetic tape and magnetic disks as secondary
storage devices. In this generation assembly language and high-level programming
languages like FORTRAN, COBOL were used. The computers used batch processing and
multiprogramming operating system.
Features:
Use of transistors
Reliable in comparison to first generation computers
11
Example: IBM 1620, IBM 7094, CDC 1604, CDC 3600, UNIVAC 1108
Advantages:
Disadvantages
operating system were used. High-level languages (FORTRAN-II TO IV, COBOL, PASCAL
PL/1, BASIC, F
Features:
IC used
More reliable in comparison to previous two generations
12
Smaller size
Generated less heat
A.C needed
Consumed lesser electricity
Supported high-level language
Example: IBM-360 series, Honeywell-6000 series, PDP (Personal Data Processor), IBM-
370/168, TDC-316
Advantages:
Less energy
Easily portable
Disadvantages:
13
(PC) revolution. In this generation time sharing, real time, networks, distributed operating
system were used. All the high-level languages like C, C++, DBASE etc., were used in this
generation.
Features:
No A.C. needed
Concept of internet was introduced
Example: DEC 10, STAR 1000, PDP 11, CRAY-1(Super Computer), CRAY-X-MP(Super
Computer)
Advantages:
Disadvantages:
AI includes:
Robotics
Neural Networks
Game Playing
Development of expert systems to make decisions in real life situations.
Natural language understanding and generation.
Features:
ULSI technology
Development of true artificial intelligence
Development of Natural language processing
Advancement in Parallel Processing
Availability of very powerful and compact computers at cheaper rates
Advantages:
Assembly
SECOND 1959 Transistors Magnetic core, Tapes and Disks No Business, Scientific Research
Language
FORTRAN,
THIRD 1965 Integrated circuits Magnetic Disks Yes BASIC, PASCAL, Business, Scientific Research
C, C++
Dbase, FoxPro,
Engineering Design, Online
FOURTH 1971 Microprocessors Semicondutor memory Yes Oracle, SQL,
Business
etc.,
FIFTH 1980 Artificial Intelligence Compact Disks, Hard Disks Yes 3GL, 4GL, LISP Robotics
16
1.6. CLASSIFICATION OF COMPUTER:
Computers are used for several applications in almost all fields of modern life.
Different types of applications require different types of computers. The digital computers
that are available nowadays vary in their sizes and types. A computer used in a home
differs in size and shape from the computer being used in a hospital. Computers can be
classified:
Analog
Digital
Hybrid
17
These computers are ideal in situations where data can be accepted directly from
measuring instrument without having to convert it into numbers or codes. It measures
Analog computers are widely used for certain specialized engineering and scientific
A Digital Computer works with digits to represent numerals, letters or other special
symbols. Digital Computers operate on inputs which are ON-OFF type and its output is
can perform arithmetic operations like addition, subtraction, multiplication and division
and also logical operations. Most of the computers available today are digital computers.
The results of digital computers are more accurate than the results of analog computers.
We can say that digital computers count and analog computers measures.
18
(iii) Hybrid Computer:
Example: In hospital Intensive Care Unit (ICU), an analog device is used which measures
patient's blood pressure and temperature etc, which are then converted and displayed in
Computers are designed for different purposes. Based on the purpose, computers
are classified as
Most computers in use today are General-Purpose computers. They are built for a
great variety of processing jobs. By using a general purpose computer and different
software, various tasks can be accomplished, including writing and editing (word
processing), manipulating facts in a data base, tracking manufacturing inventory, making
scientific calculations, or even controlling organization’s security system, electricity
consumption, and building temperature.
19
General purpose computers are designed to perform a wide variety of functions
and operations. A general purpose computer is able to perform a wide variety
of operations because it can store and execute different programs in its internal storage.
A Special-Purpose Computer are designed to be task specific and most of the times
their job is to solve one particular problem. They are also known as dedicated computers,
because they are dedicated to perform a single task over and over again. Such a
computer system would be useful in playing graphic intensive Video Games, traffic lights
control system, navigational system in an aircraft, weather forecasting, satellite launch /
tracking, oil exploration, and in automotive industries, keeping time in a digital watch,
or Robot helicopter.
While a special purpose computer may have many of the same features found in a
into the computer, which makes for a more efficient and effective operation. They
perform only one function and therefore cut down on the amount of memory needed
and also the amount of information which can be input into them. As these computers
have to perform only one task, therefore, they are fast in processing.
Based on physical size, performance and application are, we can divide computers
generally into four major categories:
i. Micro computers
ii. Mini computers
20
iii. Mainframe computer
iv. Super computer
Microcomputers are small, low-cost and single-user digital computer. They consist
of CPU, input unit, output unit, storage unit and the software. It uses microprocessor as
its CPU. Although microcomputers are stand-alone machines, they can be connected
together to create a network o f computers that can serve more than one user.
Micro computers are typically single-user system but can be used in multi-user
environment either by using Multi-user network operating systems (UNIX, Windows NT)
or LAN (Local Area Network). Microcomputers include desktop computers, notebook
computers or laptop, tablet computer, handheld computer, smart phones and netbook,
etc.,
Types:
(a) Desktop Computer or Personal Computer (PC) - It is the most common type of
(b) Notebook Computers or Laptop - They are portable and have all the features of a
desktop computer. The advantage of the laptop is that it is small in size, can be carried
anywhere. Laptops can be placed on the lap while working. Laptops are costlier than the
desktop machines.
21
(c) Netbook - These are smaller notebooks optimized for low weight and low cost, and
are designed for accessing web-based applications. Netbooks deliver the performance
needed to enjoy popular activities like streaming videos or music, emailing, Web surfing
or instant messaging.
(d) Tablet - Tablet Computer has features of the notebook computer but it can accept
input from a stylus or a pen instead of the keyboard or mouse. It is a portable computer.
(e) Handheld Computer or Personal Digital Assistant (PDA) - It is a small computer that
can be held on the top of the palm. It is small in size. PDA uses a pen or a stylus for input,
Instead of the keyboard. They have a limited memory and are less powerful. PDAs can be
connected to the Internet via a wireless connection. Example Casio and Apple are some of
the manufacturers of PDA.
(f) Smart Phones - These are cellular phones that function both as a phone and as a small
PC. They may use a stylus or a pen, or may have a small keyboard. They can be
connected to the Internet wirelessly. They are used to access the electronic-mail,
download music, play games, etc. Blackberry, Apple, HTC, Nokia and LG are some of the
manufacturers of smart phones.
(ii) Minicomputer:
systems. Minicomputers are mainly used as small or midrange servers operating business
and scientific applications. They have high processing speed and high storage capacity
than the microcomputers. Minicomputers can support 4–200 users simultaneously. The
users can access the minicomputer through their PCs or terminal.
22
Example: PDP-1, DEC Micro VAX and IBM AS/400
(iv) Supercomputers:
Supercomputers are the fastest and the most expensive machines. They have high
processing speed compared to other computers. The speed of a supercomputer is
generally measured in FLOPS (Floating point Operations per Second). Some of the faster
supercomputers can perform trillions of calculations per second.
Supercomputers are used for highly calculation-intensive tasks, such as, weather
forecasting, climate research (global warming), molecular research, biological research,
nuclear research and aircraft design. They are also used in major universities, military
agencies and scientific research laboratories.
Example: IBM Roadrunner, IBM Blue gene and Intel ASCI red
Computer Main
CPU Speed Word Length No. of Users Example
Type Memory Size
23
Micro Apple-II,
8 to 64KB 100 KIPS 8 bits 1 User
Computer IBMPC Jr
Mini 16MB to 500KIPS to 5 DEC, VAX
Computer 16 to 32 bits 4 to 8 Users
256MB MIPS PDP, IBM
KIPS - Kilo Instruction Per Second, MIPS-Million Instructions Per Second, and MFLOP - Million Floating
Point Operations Per Second.
1.7. BASIC ORGANIZATION OF A COMPUTER
A computer is a fast and accurate device, which can accept data, store data,
process them and give, desired results as output. The internal architectural design of
computers differs from one system model to another. However, the basic organization
remains the same for all computer systems. The following are the four basic components
(also called "The functional units") of a computer.
i) Input Unit
24
1. Input Unit:
The input unit of the computer system is used for feeding data and instructions to
the computer. These data and instructions given to the computer are called as input and
the devices used for giving input are called input unit or devices. A computer consists of
an I/O system. It is used by a user to communicate with a computer. For instance, a
keyboard or a mouse may be an input device for a computer, while monitors and printers
are considered output devices for a computer. In computer architecture, the combination
of the CPU and main memory is considered the brain of a computer, and from that point
of view any transfer of information from or to that combination is considered I/O. Hence,
the devices that are used to input data to the computer are called input unit or devices.
Following are few of the important input devices which are used in a computer:
Keyboard
Mouse
Joy Stick
Light pen
Scanner
25
Microphone
Keyboard
functions.
Keyboards are of two sizes 84 keys or 101/102 keys, but now keyboards with 104
keys or 108 keys are also available for Windows and Internet.
Mouse
Generally it has two buttons called left and right button and a wheel is present
between the buttons. Mouse can be used to control the position of cursor on screen, but
it cannot be used to enter text into the computer.
26
Joystick
Light Pen
Scanner
27
digital form that can be stored on the disc. These images can be edited before they are
printed.
Microphone
The main advantage of MICR is that it is fast and less error prone.
memory.
28
OMR is a special type of optical scanner used to
recognize the type of mark made by pen or pencil. It is used
b. Control Unit
c. ALU (Arithmetic Logic Unit)
29
This unit can store instructions, data and intermediate results. This unit supplies
information to the other units of the computer when needed. It is also known as internal
storage unit or main memory or primary storage or Random access memory (RAM).
Its size affects speed, power and capability. Primary memory and secondary memory
are two types of memories in the computer. Functions of memory unit are:
It stores all the data and the instructions required for processing.
b. Control Unit:
This unit controls the operations of all parts of computer but does not carry out
Functions:
Arithmetic section
Logic Section
Arithmetic Section
Logic Section
3. Output Unit:
An output device is any peripheral that receives data from a computer, usually for
display, projection, or physical reproduction. After finishing the processing by the CPU,
the output unit sends results to the user using output devices. These devices take the
machine coded output results from the CPU and convert them into a form which an
human can understand. Following are few of the important output devices which are
used in a computer.
31
(a) Monitors
(b) Graphic Plotter
(c) Printer
a. Monitors:
Monitors, commonly called as Visual Display Unit (VDU), are the main output
device of a computer. It forms images from tiny dots, called pixels that are arranged in a
rectangular form. The sharpness of the image depends upon the number of pixels.
Monitor is made up of small picture elements called pixels. The smaller the pixels, the
better the image clarity, or resolution. It takes more than one illuminated pixel to form
whole character, such as the letter ‘e’ in the word help. The screen can be divided into a
series of character boxes - fixed location on the screen where a standard character can
be placed. Most screens are capable of displaying 80 characters of data horizontally and
25 lines vertically. Two types of monitor are:
CRT LCD
(c) Printer:
Printers are one of the most commonly used peripherals on computers and are
commonly used to print text and photos.
Types of printers
Below is a list of all the different types of computer printers. Today, the most
common printers used with a computer are Inkjet and Laser printers.
3D printer
All-in-one (AIO) printer
Dot Matrix printer
Inkjet printer
Laser printer
Multifunction printer (MFP)
Thermal printer
33
4. Memory Unit:
A memory is just like a human brain. It is used to store data and instructions. Computer
memory is the storage space in computer where data is to be processed and instructions
required for processing are stored. The memory is divided into large number of small
parts called cells. Each location or cell has a unique address which varies from zero to
memory size minus one. For example if computer has 64k words, then this memory unit
has 64 * 1024=65536 memory locations. The address of these locations varies from 0 to
65535. Memory is primarily of three types:
Memory
Primary Secondary
Primary memory holds only those data and instructions on which computer is
currently working. It has limited capacity and data is lost when power is switched off. It is
generally made up of semiconductor device. These memories are not as fast as registers.
The data and instruction required to be processed reside in main memory. It is divided
34
Characteristics of Main Memory:
CPU can access it. For example: disk, CD-ROM, DVD etc.
35
Types:
ROM is permanent memory location that offers huge types of standards to save
data. But it work with read only operation. No data lose happen whenever power failure
occurs during the ROM memory work in computers.
1. PROM: Programmable Read Only Memory (PROM) maintains large storage media but
can’t offer the erase features in ROM. This type of RO maintains PROM chips to write
data once and read many. The programs or instructions designed in PROM can’t be
2. EPROM : Erasable Programmable Read Only Memory designed for recover the
problems of PROM and ROM. Users can delete the data of EPROM thorough pass on
ultraviolet light and it erases chip is reprogrammed.
3. EEPROM: Electrically Erasable Programmable Read Only Memory similar to the EPROM
but it uses electrical beam for erase the data of ROM.
The memory devices used for primary The secondary memory devices are
memory are semiconductor memories magnetic and optical memories.
36
volatile and non volatile memories, RAM is volatile
These memories are also called as internal These memories are also called as external
memory memory
RAM is volatile i.e. its contents are lost It is non-volatile i.e. its contents are
37
when the device is powered off. retained even when the device is powered
off.
The two main types of RAM are static RAM The types of ROM include PROM, EPROM
and dynamic RAM. and EEPROM.
RAM memory is only used to store the ROM memory is used to store permanent
temporary information. information and cannot be deleted.
A Computer can perform wide variety of tasks like receiving data, processing it, and
producing useful results. However, being a machine, the computer cannot perform on its
own. A computer needs to be instructed to perform even a simple task like adding two
numbers. So in order to make computer to complete the task a computer programmer
before.
sending instructions to the operating system. It is logic with a program built on program
language statements.
Program:
The heart of the programming process lies in planning the program’s logic. During
this phase of the process, the programmer plans the steps of the program, deciding what
steps to include and how to order them. The three most common planning tools are
algorithm, flowcharts and pseudocode.
After the logic is developed, the programmer can write the source code for a
Even though there are many programming languages, each computer knows only
one language that is machine language, which consists of 1s and 0s. Languages like Java
or Visual Basic are available for programmers because someone has written a translator
program that changes the programmer’s English-like high-level programming language
List of syntax
Creating an executable program
40
3. The data required to perform those instructions
There are different ways of representing the logical steps for finding a solution of a
given problem. They are:
1. Algorithm
2. Flowchart
3. Pseudocode
1.10.1. ALGORITHM:
sequence of finite instructions, used for calculation and data processing to find the
solution for a problem.
Example: To find the addition of three numbers, following algorithm can be used.
Step 1: Start
Step 2: Read three numbers A, B, C
Step 3: Add three numbers and store in SUM
Step 4: Display SUM
Step 5: Stop
Properties of an Algorithm:
41
Definiteness: Each step in algorithm is unambiguous. This means that the action
specified by the step cannot be interpreted in multiple ways and can be performed
without any confusion.
Effectiveness: It consists of basic instructions that are realizable. This means that the
instructions can be performed by using the given inputs in a finite amount of time.
Advantages:
It is easy to understand.
Disadvantages:
It is time consuming.
Example: Write an algorithm to find the largest among three different numbers
42
Step 1: Start
Step 2: Declare variables a,b and c
Step 3: Read variables a,b and c
Step 4: If a>b
If a>c
Display a is the largest number
Else
Display c is the largest number
Else
If b>c
Display b is the largest number
Else
Display c is the greatest number
Step 5: Stop
1.10.2. PSEUDOCODE:
Each statement in your pseudocode should express just one action for the
computer.
43
Example:
START Program
ENTER two numbers, A, B
ADD the numbers together
PRINT Sum
END Program
BEGIN
INPUT age
IF age >= “18" THEN
OUTPUT "Eligible for Vote"
ELSE
OUTPUT "Not eligible for Vote"
END IF
END
Keywords:
PROCESS KEYWORD
Input READ, OBRAIN, GET, PROMPT
Output PRINT, DISPLAY, SHOW
Compute COMPUTE, CALCULATE, DETERMINE
Initialize SET, INITIALIZE
Addition INCREMENT
WHILE, DO WHILE, FOR, UNTIL, IF THEN, IF,
Loop
ELSE, IF ELSE, END IF, THEN
44
3. Use standard programming structures
Even if there is no standard for pseudocode, it will be easier for other programmers
to understand your steps if you use structures from existing programming languages.
Blocks are syntactic tools that tie several instructions together into one instruction.
You can use blocks to order information. steps in Block 1 always come before steps in
Block 2.
Example:
BLOCK1
BLOCK2
BLOCK3
BLOCK2
BLOCK1
Advantages:
Disadvantages:
Example: Write a pseudocode to find the largest among three different numbers
READ x,y,z
SET big=x
IF(y>big)
big=y
END IF
IF(z=big)
big=z
END IF
WRITE big
1. In drawing a proper flow chart, all necessary requirements should be listed out in
logical order.
2. The flowchart should be clear, neat and easy to follow. There should not be any
room for ambiguity in understanding the flow chart.
3. The usual direction of the flow of a procedure or system is from left to right or top
to bottom.
4. Only one flow line should come out from a process symbol.
5. Only one flow line should enter a decision symbol, but two or three flow lines, one
for each possible answer, should leave the decision symbol.
47
6. Only one flow line is used in conjunction with terminal symbol.
7. Write within standard flow chart symbols briefly. As necessary, you can use the
annotation symbol to describe data or computational steps more clearly.
Advantages:
It provides an easy way of communication because any other person besides the
It provides a clear overview of the entire program and problem and solution.
Limitations:
problem.
Alterations and Modifications: If alterations are required the flowchart may require
re-drawing completely. This will usually waste valuable time.
48
Reproduction: As the flowchart symbols cannot be typed, reproduction of flowchart
becomes a problem.
49
Sequential means ‘one-after-the-other’. Sequential logic is the
easiest way to construct and follow. You can place each statement in
the order that you want them to be executed and the program
executes them in sequence from the Start statement to the End
statement. Sequential control is the "default" control in the sense that
every statement automatically points to the next statement in the
flowchart diagram. It is based on top-down approach.
a) IF...THEN Structure:
This makes a choice between two processes. If the condition is true, then it
performs the process. If the condition is false, then it skips the process.
Pseudocode Flowchart
50
IF (condition) THEN
process 1
....
....
ENDIF
b) IF...THEN...ELSE Structure:
In this structure if the condition is true it executes process 1 else if the condition is
false it executes process 2. In this either the process 1 or process 2 gets executed
Pseudocode Flowchart
IF (condition) THEN
process 1
....
....
ELSE
process 2
....
.....
ENDIF
c) CASE Structure:
51
A Case Structure is a branching control mechanism that allows different executions
depending on the value of the label. The Case Structure is analogous to the Case block in
programming language in which, based on what case value the input variable matched,
the case structure will choose the correct cases for execution.
Pseudocode Flowchart
CASE type
Case Type-1:
process 1
Case Type-2:
process 2
....
....
Case Type-n:
process n
Repetition statements are called loops, and are used to repeat the same code
multiple times in succession. The number of repetitions is based on criteria defined in the
loop structure, usually a true/false expression. Two types of loop structures are WHILE
and DO..WHILE.
i) WHILE:
52
In this the condition for looping is checked at the beginning of the loop. It is a top
tested loop. If the condition is true the loop will be executed. If the condition is false the
loop will not be executed.
Pseudocode Flowchart
WHILE (condition)
process 1
....
....
END WHILE
ii) DO...WHILE:
In this structure the condition is checked at the bottom. It is a bottom tested loop.
Hence the body of the loop is executed atleast once even if the condition is false.
Pseudocode Flowchart
DO
.....
.....
process 1
....
....
WHILE (condition)
Examples
53
Example 1: Find the area of a triangle
Algorithm Flowchart
Step 1: Start
Step 5: Stop
Algorithm Flowchart
Step 1: Start
Step 5: Stop
54
Example 3: Find the given number is leap year or not.
Algorithm Flowchart
Step 1: Start
Step 4: Stop
Algorithm Flowchart
55
Step 1: Start
Step 3: If A is greater
than B,
compare it
with C.
Step 4: If A is greater
than C, then
print A is big.
Step 5: If A is not
greater than
B and C, then
compare B
and C.
Step 6: If B is greater
than C print
B is big else
print C is big.
56
Example 5: Find the factorial of a given number.
Algorithm Flowchart
Step 1: Start
Step 6: Stop
57
Example 6: Find whether the given number is odd or even.
Algorithm Flowchart
Step 1: Start
Step 4: Stop
58
Example 7: Find the sum of first N natural numbers.
Algorithm Flowchart
Step 1: Start
59
Example 8: Draw a flow chart to find area and circumference of a circle.
Algorithm Flowchart
Step 1: Start
Step 5: Stop
60
61