You are on page 1of 104

This is only for Sample Materials

for Full Book order online and available at all Leading Bookstores

COMPUTER SCIENCE

m
co
HIGHER SECONDARY FIRST YEAR
VOLUME I & II

s.
ok
Based on the updated new textbook for the year 2019 - 20

o Salient Features
ab
 Prepared as per the updated new textbook for the year 2019 - 20
 E
xhaustive Additional MCQs, VSA, SA, LA questions with answers are given in
each chapter.

ovt. Model Question Paper-2018 (Govt. MQP-2018), First Mid-Term Test


 G
ur

(FMT - 2018), Quarterly Exam - 2018 (QY-2018) and Half Exam (HF -2018)
Questions are incorporated at appropriate sections.

Govt. Model Question Paper - 1 (2018) with Answer Key.


.s

 Sura’s Model Question Paper - 1 - 2 with Answer Key.


w

 March 2019 Question Paper with Answer Key.


w
w

SURA PUBLICATIONS
Chennai

orders@surabooks.com PH: 9600175757 / 8124201000 / 8124301000


This is only for Sample Materials
for Full Book order online and available at all Leading Bookstores

2019-20 Edition
NOTE FROM PUBLISHER
© Reserved with Publishers
It gives me great pride and pleasure in bringing to you
ISBN : 978-93-5330-071-5 Sura’s Computer science Guide (Volume-I & II) for +1 Standard.
A deep understanding of the text and exercises is rudimentary to
Code No : SG 274

m
have an insight into Computer Science. The students and teachers
Author : have to carefully understand the topics and exercises.
Mr. Shanmugasundaram Sura’s Computer Science +1 Standard Guide encompasses

co
(Post Graduate Teacher, Chennai)
all the requirements of the students to comprehend the text and
the evaluation of the textbook.
Head Office:
 It will be a teaching companion to teachers and a learning
1620, ‘J’ Block, 16th Main Road, companion to students.

s.
Anna Nagar, Chennai - 600 040.
 As the guide has been framed based on the ‘New 100 Marks
Phones : 044-26161088, 26161099.
Pattern’ and the public exam question paper is 70 Marks,
Mobile : 96001 75757 / 81242 01000 /
it provides a precise and clear understanding of text and

ok
81243 01000
exercises from the examination perspective.
Whatsapp : 81242 01000
e-mail : orders@surabooks.com  Exhaustive Additional MCQs, VSA, SA, LA questions with
website : www.surabooks.com answers are given in each chapter.
 These features will help students practice and learn
Our Guides for XI Standard
o effectively all the sections of the textbook.
✤ Sura’s Tamil
ab
✤ Sura’s English Though these salient features are available in our Sura’s
✤ Sura’s Mathematics (EM/TM ) Computer Science Guide 11 th Standard, I cannot negate the
✤ Sura’s Physics (EM/TM) indispensable role of the teachers in assisting the student to
Sura’s Chemistry (EM/TM)

understand the Computer Science.
✤ Sura’s Biology (EM/TM)
ur

✤ Sura’s Computer Science (EM/TM) I sincerely believe this guide satisfies the needs of the students
✤ Sura’s Commerce (EM/TM) and bolsters the teaching methodologies of the teachers.
✤ Sura’s Economics (EM/TM)
✤ Sura’s Accountancy (EM/TM) I pray the almighty to bless the students for consummate
✤ Sura’s Business Maths (EM)
.s

success in their examinations. - Publisher


Also available 1 Mark Q & A (EM/TM),2,3 Marks
(EM/TM) and 5 Marks Q & A (EM / TM) for all  Mr. Subash Raj, B.E., M.S.
Subjects.
All the Best
w

For More Information - Contact


w

Doubts in Our Guides : enquiry@surabooks.com


For Order : orders@surabooks.com
w

Contact : 96001 75757 / 8124301000


Whatsapp : 8124201000 / 9840926027
Online Site : www.surabooks.com
For Free Study Materials Visit http://tnkalvi.in

(ii)

orders@surabooks.com PH: 9600175757 / 8124201000 / 8124301000


This is only for Sample Materials
for Full Book order online and available at all Leading Bookstores

Contents
Chapter
No
Title P. No

m
Volume - I

UNIT I - FUNDAMENTALS OF COMPUTER AND WORKING

co
WITH A TYPICAL OPERATING SYSTEMS (WINDOWS & LINUX)

1. Introduction to Computers 1-20


2. Number Systems 21-50

s.
3. Computer Organization 51-67
4. Theoretical Concepts of Operating System 68-81
5. Working with Typical Operating System (Windows & Linux) 82-101

ok
UNIT II - ALGORITHMIC PROBLEM SOLVING
6. Specification and Abstraction 102-111
7. Composition and Decomposition
o 112-121
8. Iteration and recursion 122-128
Volume - II
ab
UNIT III - INTRODUCTION TO C++

9. Introduction to C++ 129-166


ur

10. Flow of Control 167-186


11. Functions 187-206
12. Arrays and Structures 207-227
.s

UNIT IV - OBJECT ORIENTED PROGRAMMING WITH C++


13. Introduction to Object Oriented Programming Techniques 228-235
14. Classes and objects 236-265
w

15. Polymorphism 266-277


16. Inheritance 278-303
w

UNIT V – COMPUTER ETHICS AND CYBER SECURITY


17. Computer Ethics and Cyber Security 304-314
w

18. Tamil Computing 315-318

Govt. Model Question Paper & Sura’s Model Question Paper 1 - 2 with Answer Key. 319-339

March 2019 Question Paper with Answer Key. 340-348

(iii)

orders@surabooks.com PH: 9600175757 / 8124201000 / 8124301000


This is only for Sample Materials
for Full Book order online and available at all Leading Bookstores

TO ORDER WITH US

SCHOOLS and TEACHERS:

m
We are grateful for your support and patronage to ‘SURA PUBLICATIONS’
Kindly prepare your order in your School letterhead and send it to us.

co
For Orders contact: 81242 01000 / 81243 01000

DIRECT DEPOSIT
A/c Name : Sura Publications A/c Name : Sura Publications

s.
Our A/c No. : 36550290536 Our A/c No. : 21000210001240
Bank Name : STATE BANK OF INDIA Bank Name : UCO BANK
Bank Branch : PADI Bank Branch : Anna Nagar West

ok
IFSC : SBIN0005083 IFSC : UCBA0002100

A/c Name : Sura Publications A/c Name : Sura Publications


Our A/c No. : 6502699356
o Our A/c No. : 1154135000017684
Bank Name : INDIAN BANK Bank Name : KVB BANK
Bank Branch : ASIAD COLONY Bank Branch : Anna Nagar
ab
IFSC : IDIB000A098 IFSC : KVBL0001154

After Deposit, please send challan and order to our address.


email : orders@surabooks.com / Whatsapp : 81242 01000.
ur

DEMAND DRAFT / CHEQUE


Please send Demand Draft / cheque in favour of ‘SURA PUBLICATIONS’
payable at Chennai.
.s

The Demand Draft / cheque should be sent with your order in School letterhead.

STUDENTS :
w

Order via Money Order (M/O) to


w

SURA PUBLICATIONS
1620, ‘J’ Block, 16th Main Road, Anna Nagar,
Chennai - 600 040.
w

Phones : 044-26162173, 26161099.


Mobile : 96001 75757/ 81242 01000/81243 01000.
email : orders@surabooks.com Website : www.surabooks.com

(iv)

orders@surabooks.com PH: 9600175757 / 8124201000 / 8124301000


This is only for Sample Materials
for Full Book order online and available at all Leading Bookstores

m
co
s.
COMPUTER SCIENCE
o ok
ab

VOLUME - I
ur
.s
w
w
w

[1]

orders@surabooks.com PH: 9600175757 / 8124201000 / 8124301000


This is only for Sample Materials
for Full Book order online and available at all Leading Bookstores

Contents

m
co
s.
Chapter

ok
No
Title P. No

UNIT I - FUNDAMENTALS OF COMPUTER AND WORKING


WITH A TYPICAL OPERATING SYSTEMS (WINDOWS & LINUX)
o
1. Introduction to Computers 1-20
ab
2. Number Systems 21-50
3. Computer Organization 51-67
4. Theoretical Concepts of Operating System 68-81
ur

5. Working with Typical Operating System (Windows & Linux) 82-101


UNIT II - ALGORITHMIC PROBLEM SOLVING
6. Specification and Abstraction 102-111
.s

7. Composition and Decomposition 112-121


8. Iteration and recursion 122-128
w
w
w

[2]

orders@surabooks.com PH: 9600175757 / 8124201000 / 8124301000


This is only for Sample Materials
for Full Book order online and available at all Leading Bookstores

Volume I
UNIT- I
FUNDAMENTALS OF COMPUTER AND
WORKING WITH A TYPICAL OPERATING

m
SYSTEMS (WINDOWS & LINUX)

1I

co
Chapter ntroduction to Computers

s.
CHAPTER SNAPSHOT
o
 1.1. Introduction to Computers
ok 1.5.2.1. Arithmetic and Logic Unit
ab
 1.2. Generations of Computers 1.5.2.2. Control Unit
 1.3. Sixth Generation Computing 1.5.3. Output Unit
 1.4. Data and Information  1.5.4. Unit Memory
ur

 1.5. Components of a Computer  1.5.5. Input and Output devices


1.5.1. Input Unit  1.6. Booting of Computer
1.5.2. Central Processing Unit
.s
w
w
w

[3]

orders@surabooks.com PH: 9600175757 / 8124201000 / 8124301000


This is only for Sample Materials
for Full Book order online and available at all Leading Bookstores
4 Sura’s  XI Std - Computer Science ➠ Volume I ➠ Unit I ➠ Chapter 1

Evaluation
Section - A 9. Which one of the following is the main memory?
(a) ROM (b) RAM
Choose the Correct Answer (c) Flash drive (d) Hard disk

m
 [Ans. (b) RAM]
1. First generation computers used ……………
(a) Vacuum tubes (b) Transistors 10. Which generation of computer used IC’s?
(c) Integrated circuits (d) Microprocessors (a) First (b) Second (c) Third (d) Fourth

co
 [Ans. (a) Vacuum tubes]  [Ans. (c) Third]

2. Name the volatile memory ……………


Section - B
(a) ROM (b) PROM (c) RAM (d) EPROM
 [Ans. (c) RAM] Short Answer

s.
3. Identify the output device ……………
1. What is a computer?
(a) Keyboard (b) Memory
Ans. (i) A computer is an electronic device that

ok
(c) Monitor (d) Mouse
 [Ans. (c) Monitor] manipulates information, or data. It has the
ability to store, retrieve, and process data.
4. Identify the input device ……………  [FMT 2018] (ii) Computer works faster than human being and
(a) Printer (b) Mouse
o given the values more accuracy and reliable
(c) Plotter (d) Projector
2. Distinguish between data and information.
 [Ans. (b) Mouse]
 [FMT 2018]
ab
5. …………… Output device is used for printing Ans. Data Information
building plan, flex board, etc.
Data is defined as an Information is a
(a) Thermal printer (b) Plotter
unprocessed collection collection of facts from
(c) Dot matrix (d) inkjet printer of raw facts, suitable which conclusions may
 [Ans. (b) Plotter]
ur

for communication, be drawn.


6. In ATM machines, which one of the following is interpretation or
used to processing.
(a) Touch Screen (b) Speaker (Eg) 134, 16, 'Kavitha', (Eg) Kavitha is 16 years
.s

(c) Monitor (d) Printer 'C' old.


 [Ans. (a) Touch Screen] 3. What are the components of a CPU?
Ans. The CPU has three components which are Control
w

7. When a system restarts ……………….. which


type of booting is used. unit, Arithmetic and logic unit (ALU) and Memory
(a) Warm booting (b) Cold booting unit.
(c) Touch boot (d) Real boot. What is the function of an ALU?
w

4.
 [Ans. (a) Warm booting] Ans. (i) The ALU performs arithmetic operations.
8. Expand POST  [FMT 2018] (ii) The result of an operation is stored in internal
w

(a) Post on self Test memory of CPU.


(b) Power on Software Test (iii) The logical operations of ALU promote the
decision making ability of a computer.
(c) Power on Self Test
(d) Power on Self Text 5. Write the functions of control unit.
 [Ans. (c) Power on Self Test] Ans. The control unit controls the flow of data between
the CPU, memory and I/O devices. It also controls
the entire operation of a computer.

orders@surabooks.com PH: 9600175757 / 8124201000 / 8124301000


This is only for Sample Materials
for Full Book order online and available at all Leading Bookstores
Sura’s  XI Std - Computer Science ➠ Introduction to Computers 5

6. What is the function of memory? 3. What is an input device? Give two examples.
Ans. The primary memory is used to temporarily store the Ans. Input device is used to feed any form of data to the
programs and data when the instructions are ready to computer, which can be stored in the memory unit
execute. The secondary memory is used to store the for further processing.
data permanently. Example: Keyboard, Mouse, Scanner, Fingerprint
scanner, Track Ball, Retinal Scanner, Light pen etc.

m
7. Differentiate Input unit and Output unit.
4. Name any three output devices.
Ans. Input Unit Output Unit
Ans. (i) Monitor (ii) Printer
Input unit is used An output unit is any
(iii) Plotter (iv) Speaker

co
to feed any form of hardware component
data to the computer, that conveys (v) Multimedia projectors are the output devices.
which can be stored in information to users in 5. Differentiate optical and Laser mouse.  [HF. 2018]
the memory unit for an understandable form.
Ans. Optical Mouse Laser Mouse
further processing.

s.
Measures the motion Measures the motion and
Example : Example : and acceleration of acceleration of pointer.
Keyboard, mouse etc. Monitor, Printer etc. pointer.

ok
8. Distinguish Primary and Secondary memory. It uses light source Laser Mouse uses Laser
instead of ball to Light.
Ans. Primary Memory Secondary memory judge the motion of
It is used to It is used to store the the pointer.
temporarily store the data permanently.
Optical mouse is less Laser Mouse is highly
programs and data
when the instructions
o sensitive towards sensitive and able to work
surface. on any hard surface.
are ready to execute.
ab
It is volatile, the It is non-volatile, the 6. Write short note on impact printer.
content is lost when content is available even Ans. Impact printers :
the power supply is after the power supply is (i)  These printers print with striking of hammers or
switched off. switched off. Eg. ROM, pins on ribbon. These printers can print on multi-
ur

Eg. RAM. CD-ROM, DVD ROM. part (using carbon papers) by using mechanical
Section - C pressure. For example, Dot Matrix printers and
Line matrix printers are impact printers.
Explain in brief
.s

(ii) A Dot matrix printer that prints using a fixed


1. What are the characteristics of a computer? number of pins or wires.
Ans. (i) Computer is the powerful machine. (iii) Line matrix printers use a fixed print head for
w

(ii) It can perform large number of tasks. printing.


(iii) The main capacities of computer are work
length, speed accuracy, diligence, versatility 7. Write the characteristics of sixth generation.
w

memory and automation and lots of more tasks. Ans. (i) In the Sixth Generation, computers could be
2. Write the applications of computer. defined as the era of intelligent computers based
Ans. The various applications of computers are,
on Artificial Neural Networks.
w

(i) Business (ii) Education (ii) One of the most dramatic changes in the sixth
(iii) Marketing (iv) Banking generation will be the explosive growth of
(v) Insurance (vi) Communication Wide Area Networking.
(vii) Health care (iii) Natural Language Processing (NLP) is a
(viii) Engineering - Robotics, Nano technology, Bio component of Artificial Intelligence (AI).
Engineering (iv) It provides the ability to develop the computer
program to understand human language.

orders@surabooks.com PH: 9600175757 / 8124201000 / 8124301000


This is only for Sample Materials
for Full Book order online and available at all Leading Bookstores
6 Sura’s  XI Std - Computer Science ➠ Volume I ➠ Unit I ➠ Chapter 1
8. Write the significant features of monitor. (ii) Central Processing Unit : CPU is the major
Ans. Monitor: component which interprets and executes soft-
ware instructions. It also control the operation
(i) Monitor is the most commonly used output
of all other components such as memory, input
device to display the information. It looks like a TV.
and output units.
(ii) Pictures on a monitor are formed with picture
(iii) Arithmetic and Logic Unit : The ALU is

m
elements called PIXELS.
(iii) Monitors may either be Monochrome which a part of the CPU where various computing
display text or images in Black and White or functions are performed on data. The ALU
can be color, which display results in multiple performs arithmetic operations such as addition,

co
colors. subtraction, multiplication, division and logical
(iv) There are many types of monitors available operations.
such as CRT (Cathode Ray Tube), LCD (Liquid
Crystal Display) and LED (Light Emitting Control Unit

s.
Diodes).
(v) The video graphics card helps the keyboard to ALU
communicate with the screen. Input Unit Output Unit
(vi) It acts as an interface between the computer and

ok
Internal
Memory Data Path
display monitor. Control Path
Section - D Main Memory
Explain in detail o Secondary Storage
1. Explain the basic components of a computer with Components of a Computer
a neat diagram.  [Govt.MQP, FMT-2018]
ab
Ans. Components of a Computer :
(iv) Control Unit : The control unit controls the
 The computer is the combination of hardware and
software. Hardware is the physical component of a flow of data between the CPU, memory and I/o
computer like motherboard, memory devices, mon- devices. It also controls the entire operation of a
itor, keyboard etc., while software is the set of pro- computer.
ur

grams or instructions. Both hardware and software (v) Output Unit : An output unit is any hardware
together make the computer system to function. component that conveys information to users
Every task given to a computer follows an Input- in an understandable form. Example : Monitor,
process - output cycle (IPO cycle).
.s

Printer etc.
(vi) Memory Unit : The Memory Unit is of
two types which are primary memory and
secondary memory. The primary memory is
w

used to temporarily store the programs and data


when the instructions are ready to execute. The
secondary memory is used to store the data
w

permanently. The Primary Memory is volatile,


that is, the content is lost when the power supply
is switched off. The Random Access Memory
w

(RAM) is an example of a main memory. The


(i) 
Input unit : Input unit is used to feed any form Secondary memory is non volatile, that is, the
of data to the computer, which can be stored in content is available even after the power supply
the memory unit for further processing. is switched off. Hard disk, CD-ROM and DVD
Example : keyboard, mouse etc. ROM are examples of secondary memory.

orders@surabooks.com PH: 9600175757 / 8124201000 / 8124301000


This is only for Sample Materials
for Full Book order online and available at all Leading Bookstores
Sura’s  XI Std - Computer Science ➠ Introduction to Computers 7

2. Discuss the various generations of computers.  [QY. 2018]


Main Component
Ans. S.N Generation Period Merits/ Demerits
used
1 First Generation 1942-1955 Vaccum tubes ‰‰Big in size
‰‰Consumed more power

m
‰‰Malfunction due to overheat

‰‰Machine Language was used

co
First Generation Computer - ENIAC, EDVAC, UNIVAC 1
ENIAC weighed about 27 tons, size 8 feet × 100 feet × 3 feet and consumed around 150 watts of power

2. Second Generation 1955-1964 Transistors ‰‰Smallercompared to First Generation

s.
‰‰GeneratedLess Heat
‰‰Consumed less power compared to first
generation

ok
‰‰Punched cards were used

‰‰First operating system was developed -


Batch Processing and Multiprogramming
Operating System
‰‰Machine language as well as Assembly
o language was used.
Second Generation Computers - IBM 1401, IBM 1620, UNIVAC 1108
ab
3. Third 1964-1975 Integrated Circuits ‰‰Computers were smaller, faster and more
Generation (IC) reliable
‰‰Consumed less power.

‰‰High Level Languages were used


ur

Third Generation Computers - IBM 360 series, Honeywell 6000 series


4. Fourth 1975-1980 Microprocessor ‰‰Smallerand Faster.
Generation Very Large Scale ‰‰Microcomputer series such as IBM and
Integrated Circuits APPLE were developed.
.s

(VLSI) ‰‰Portable Computers were introduced.

5. Fifth 1980-till Ultra Large Scale ‰‰Parallel Processing


Generation date Integration (ULSI) ‰‰Super conductors
w

‰‰Computers size was drastically reduced.


‰‰Can recognize Images and Graphics
‰‰Introduction of Artificial Intelligence and
w

Expert Systems
‰‰Able to solve high complex problems
including decision making and logical
reasoning
w

6. Sixth In future ‰‰Parallel and Distributed computing


Generation ‰‰Computers have become smarter, faster
and smaller
‰‰Development of robotics

‰‰Natural Language Processing

‰‰Development of Voice Recognition


Software

orders@surabooks.com PH: 9600175757 / 8124201000 / 8124301000


This is only for Sample Materials
for Full Book order online and available at all Leading Bookstores
8 Sura’s  XI Std - Computer Science ➠ Volume I ➠ Unit I ➠ Chapter 1
3. Explain the following : a. Inkjet Printer b. Multi Multimedia Projectors:
media projector c. Bar code / QR code Reader (i) Multimedia projectors are used to produce
Ans. Inkjet Printers: computer output on a big screen.
(i)  Inkjet Printers use colour cartridges which (ii) These are used to display presentations in
combined Magenta, Yellow and Cyan inks to meeting halls or in classrooms.
create color tones. A black cartridge is also used

m
Bar Code / QR Code Reader:
for monochrome output. Inkjet printers work by
(i) A Bar code is a pattern printed in lines of
spraying ionised ink at a sheet of paper.
different thickness. The Bar code reader scans
(ii) They use the technology of firing ink by heating

co
it so that it explodes towards the paper in the information on the bar codes transmits to the
bubbles or by using piezoelectricity in which Computer for further processing.
tiny electric currents controlled by electronic (ii) The system gives fast and error free entry of
circuits are used inside the printer to spread ink information into the computer.
in jet speed.

s.
QR (Quick response) Code:
(iii) An Inkjet printer can spread millions of dots of
The QR code is the two dimension bar code
ink at the paper every single second.
which can be read by a camera and processed to
interpret the image.

ok
additional questions and Answers

Choose the Correct Answers 1 MARK


o 5. Which of the following is not a first generation
computers?
I. Choose the Correct
ab
options for the (a) ENIAC (b) EDVAC
below Questions. (c) UNIVAC 1 (d) IBM1401
 [Ans. (d) IBM1401]
1. How many types of Booting process in system ?
(a) 3 (b) 2  [QY. 2018] 6. Which component used in third generation
ur

(c) 5 (d) 4  [Ans. (b) 2] computers?


2. Which of the following led us today to extremely (a) Vacuum Tubes (b) Transistors
high speed calculating device? (c) IC (d) Microprocessor
.s

(a) Laptop (b) Tabulating Machine  [Ans. (c) IC]


(c) Abacus (d) ENIAC 7. Which of the following is a Third generation
 [Ans. (c) Abacus] computers?  [Govt.MQP-2018]
w

(a) Vacuum tubes (b) Transistor


3. In which year the concept of the analytical engine
(c) Integrated Circuits (d) Microprocessor
was invented?
(a) 1837 (b) 1910 (c) 1991 (d) 1836  [Ans. (b) Transistor]
w

 [Ans. (a) 1837] 8. In which generation, the Voice Recognition


4. Which of the following period the first generation software developed?
computers belongs? (a) Sixth (b) Fourth (c) Third (d) Second
w

(a) 1956-1963 (b) 1940-1956  [Ans. (a) Sixth]


(c) 1964-1971 (d) 1980-1990
9. Which generation gave a start to parallel
 [Ans. (b) 1940-1956]
computing?
(a) fourth (b) fifth (c) sixth (d) seventh
 [Ans. (c) sixth]

orders@surabooks.com PH: 9600175757 / 8124201000 / 8124301000


This is only for Sample Materials
for Full Book order online and available at all Leading Bookstores
Sura’s  XI Std - Computer Science ➠ Introduction to Computers 9

10. Which of the following is not a form of parallel 19. Which device is very safe and convenient for
computing? security instead of password?
(a) bit level (b) instruction level (a) Scanner (b) Fingerprint Scanner
(c) task parallelism (d) Robotics (c) Track ball (d) Retinal Scanner
 [Ans. (d) Robotics]  [Ans. (b) Fingerprint Scanner]

m
11. Which of the following holds the data and 20. Which of the following device uses CCD Electronic
instructions during the processing? chip?
(a) Input unit (b) output unit (a) OCR (b) BCR

co
(c) Memory unit (d) Software (c) Voice Input Systems (d) Digital Camera
 [Ans. (c) Memory unit]  [Ans. (d) Digital Camera]
12. Which unit does the processing of data? 21. In which device the keys are arranged in a cluster?
(a) CPU (b) Registers (a) Keyboard (b) Keyer

s.
(c) Input unit (d) Output unit
(c) Barcode Reader (d) Touch Screen
 [Ans. (a) CPU]
 [Ans. (b) Keyer]
13. Which of the following is the heart of the

ok
computer? 22. Which Generations of computer used ULSI?
(a) CPU (b) HDD (c) SDD (d) ANN (a) Third (b) Fourth  [HF. 2018]
 [Ans. (a) CPU]
(c) Fifth (d) Sixth
14. Which of the following operations of ALU promote  [Ans. (c) Fifth]
o
decision -making ability of a computer? 23. Who was the inventor of the electronic digital
(a) Logical (b) Relational computer?
ab
(c) Arithmetic (d) Binary (a) John Vincent Atanasoft
 [Ans. (a) Logical] (b) J. Presper Eckert
(c) John Mauchly
15. Which of the following is not a non volatile
memory? (d) Charles babbage
ur

(a) ROM (b) Hard disk  [Ans. (a) John Vincent Atanasoft]
(c) CD-ROM (d) RAM 24. Which company developed first digital computer?
 [Ans. (d) RAM] (a) Atanasoft Berry Computer
.s

16. Which one of the following is Biometric Device? (b) AT & T bell
 [QY. 2018] (c) IBM
(a) Scanner (b) Fingerprint Scanner (d) Microsoft
w

(c) Light Pen (d) Mouse  [Ans. (a) Atanasoft Berry Computer]
 [Ans. (b) Fingerprint Scanner]
25. Which of the following are the computer systems
w

17. Who invented the computer mouse? inspired by the biological neural networks?
(a) Douglas Engelbart (b) Bill English (a) NLP (b) IBM
(c) Apple Lisa (d) Henry Babbage (c) Robotics (d) ANN [Ans. (d) ANN]
w

 [Ans. (a) Douglas Engelbart]


26. Which of the following has become the dominant
18. Which device works like a xerox machine?
(a) Retinal scanner (b) OCR paradigm in computer architecture?
(c) OMR (d) Scanner (a) Parallel computing
(b) parallel processing
 [Ans. (d) Scanner]
(c) Multi tasking
(d) Multi processing [ Ans. (a) Parallel computing]

orders@surabooks.com PH: 9600175757 / 8124201000 / 8124301000


This is only for Sample Materials
for Full Book order online and available at all Leading Bookstores
10 Sura’s  XI Std - Computer Science ➠ Volume I ➠ Unit I ➠ Chapter 1
27. Which of the following concerned with the 36. W
 hich of the following issue an error message if
interactions between computers and human any computer hardware not defected?
language? (a) BIOS (b) BUS (c) RAM (d) POST
(a) Artificial Neurons  [Ans. (a) BIOS]
(b) Neural network 37. W
 hich device produce graphical output on
(c) Artificial intelligence

m
papers?
(d) Natural language processing (a) Scanner (b) Touch Screen
 [Ans. (c) Artificial intelligence] (c) Plotter (d) Track ball

co
28. Which of the following is the logical machine which  [Ans. (c) Plotter]
interprets and executes software instructions?
38. W
 hich code checks partition table for an active
(a) CPU (b) ALU
partition in a computer?
(c) Control Unit (d) Memory Unit
(a) MBR (b) Marse (c) Binary (d) Object
 [Ans. (a) CPU]

s.
 [Ans. (a) MBR]
29. How many classification of memories in memory
unit? 39. Which of the following is a type of computation
in which many calculations are carried out
(a) 2 (b) 3

ok
simultaneously?
(c) 4 (d) more than 2
(a) NLP (b) ANN
 [Ans. (a) 2]
(c) Parallel Processing (d) Parallel Computing
30. How many types of Keyboards used to input the
 [Ans. (d) Parallel Computing]
data?
(a) 3 (b) 2 (c) 4 (d) 5
o 40. Which of the following devices not stores the date
 [Ans. (a) 3] permanently?
ab
31. How many types of pointing device are there? (a) HDD (b) SSD
(a) 2 (b) 3 (c) 1 (d) Many (c) Tape Drives (d) RAM
 [Ans. (a) 2]  [Ans. (d) RAM]
41. Which of the following devices stores the data
ur

32. Which mouse has as many as 12 buttons?


(a) Laser (b) Optical permanently?
(c) Mechanical (d) Both a and b (a) HDD (b) Tape drives
 [Ans. (a) Laser] (c) SSD (d) All of these
.s

 [Ans. (d) All of these]


33. Which printer do not use striking mechanism for
printer?
II. Match List I with List II and Select
(a) Inkjet (b) Laser
w

the Correct Answer using the Codes given


(c) Thermal (d) All of these
below.
 [Ans. (d) All of these]
w

34. W
 hich device is used to produce computer output 1. List I List II
on a big screen?
(i) Expert System 1 Second
(a) Monitor (b) LED
Generation
w

(c) Projector (d) Monochrome Monitor


(ii) Batch Processing 2 Fourth
 [Ans. (c) Projector]
Generation
35. W
 hich of the following is the diagnostic testing (iii) NLP 3 Six Generation
sequence of the computer hardware? (iv) Introduction of 4 Fifth Generation
(a) POST (b) BIOS (c) MAR (d) MBR Laptop
 [Ans. (a) POST]

orders@surabooks.com PH: 9600175757 / 8124201000 / 8124301000


This is only for Sample Materials
for Full Book order online and available at all Leading Bookstores
Sura’s  XI Std - Computer Science ➠ Introduction to Computers 11

Codes: 4.
List I List II
(i) (ii) (iii) (iv)
(a) 4 1 3 2
(i) Used to feed data to 1 CPU
(b) 1 3 2 4
the computer
(c) 3 4 1 2 (ii) Controls the operation 2 ALU
of memory Unit

m
(d) 4 3 1 2
 [Ans. (a) (i)-4, (ii)-1, (iii)-3, (iv)-2] (iii) Computing functions 3 Control
2. are performed on data Unit
List I List II (iv) Controls the flow of 4 Input Unit

co
(i) EDVAC 1 Second Generation data between memory
Computer
unit and I/O Units.
(ii) APPLE 2 Fifth Generation
Computer Codes:

s.
(iii) IBM 1620 3 First Generation (i) (ii) (iii) (iv)
Computer (a) 4 1 2 3
(iv) Expert System 4 Fourth Generation (b) 2 1 4 3

ok
Computer (c) 4 3 1 2
(d) 3 4 1 2
 [Ans. (a) (i)-4, (ii)-1, (iii)-2, (iv)-3]
Codes:
(i) (ii) (iii) (iv) 5.
(a) 4 1 3 2
o List I List II
(b) 1 3 2 4
(i) First generation 1 Integrated
ab
(c) 4 3 1 2 Circuits
(d) 3 4 1 2
 [Ans. (d) (i)-3, (ii)-4, (iii)-1, (iv)-2] (ii)Second 2 Microprocessor
generation
3. List I List II (iii) Third generation 3 Transistors
ur

(i) Out device 1 Executes Instruction (iv) Fourth generation 4 Vacuum tubes
(ii) CPU 2 Delivers the data Codes:
processed by CPU (i) (ii) (iii) (iv)
.s

(iii) Memory 3 R etrieve the data is (a) 1 2 3 4


possible (b) 3 4 2 1
(iv) Mass Storage 4 Temporarily stores (c) 4 3 1 2
w

Device data (d) 2 3 1 4


 [Ans. (c) (i)-4, (ii)-3, (iii)-1, (iv)-2]
Codes: 6.
w

(i) (ii) (iii) (iv) List I List II


(a) 4 1 3 2 (i) Input unit 1 I/o devices
(b) 2 1 4 3
w

(ii) Memory unit 2 Monitor


(c) 4 3 1 2
(d) 3 4 1 2
(iii) Control unit 3 Rom
 [Ans. (b) (i)-2, (ii)-1, (iii)-4, (iv)-3] (iv) Output unit 4 Keyboard

orders@surabooks.com PH: 9600175757 / 8124201000 / 8124301000


This is only for Sample Materials
for Full Book order online and available at all Leading Bookstores
12 Sura’s  XI Std - Computer Science ➠ Volume I ➠ Unit I ➠ Chapter 1
Codes: 5. The component used in fourth generation
(i) (ii) (iii) (iv) computers are ................ .
(a) 1 2 3 4 (a) ICS (b) Transistors
(b) 3 4 2 1 (c) VLSI (d) Vacuum tube
(c) 4 3 1 2  [Ans. (c) VLSI]
6. Laptops, Notebook, Tablets are belongs to

m
(d) 2 3 1 4
............... generation computers.
 [Ans. (c) (i)-4, (ii)-3, (iii)-1, (iv)-2]
(a) First (b) Second (c) Third (d) Fourth
7.  [Ans. (d) Fourth]

co
List I List II 7. The fifth generation computers belongs to ...........
(i) Information 1 Motherboard (a) 1971-1980 (b) 1980-1990
(c) 1964-1971 (d) 1940-1956
(ii) Hardware 2 Set of programs
 [Ans. (b) 1980-1990]
(iii) Data 3 Convey some

s.
meaning 8. Name the software introduced in fifth generation
(iv) Software 4 Set of raw facts computers ................... .
(a) Artificial Neural Networks
Codes:

ok
(i) (ii) (iii) (iv) (b) Artificial Intelligence
(a) 1 2 3 4 (c) Robotics
(b) 3 1 4 2 (d) Natural language processing
(c) 4 3 2 1
o  [Ans. (b) Artificial Intelligence]
(d) 2 3 1 4 9. Robotics developed in .................. generation.
 [Ans. (b) (i)-3, (ii)-1, (iii)-4, (iv)-2] (a) Third (b) Fourth (c) Fifth (d) Sixth
ab
 [Ans. (d) Sixth]
III. Choose the Correct Option and Fill in 10. ENIAC was invented by ................. .
the Blanks. (a) John Vincent
1. The first calculating device is ........... . (b) Cliff Berry
ur

(a) ENIAC (b) Analytical Engine (c) Presper Eckert, John Mauchly
(c) EDVAC (d) Abacus (d) Earl R Johnson and Atanasoff
 [Ans. (d) Abacus]  [Ans. (c) Presper Eckert, John Mauchly]
.s

2. The component used in second generation 11. Expand NLP .................. .


computers is ................... .
(a) National Language Problem
(a) Transistors (b) ICs
w

(b) Natural Language Processing


(c) Vacuum tubes (d) Microprocessors
 [Ans. (a) Transistors] (c) Network Language Program
(d) Network Local Processing
3. The Second generation computers belongs to
w

 [Ans. (b) Natural Language Processing]


period .................... .
(a) 1940-1956 (b) 1956-1963 12. NLP is a component of .................. .
(c) 1980-1990 (d) 1964-1971 (a) Expert systems
w

 [Ans. (a) 1940-1956] (b) Robotics


4. The fourth generation belongs to .......... . (c) Parallel computing
(a) 1940-1956 (b) 1971-1980 (d) Artificial Intelligence
 [Ans. (d) Artificial Intelligence]
(c) 1964-1971 (d) 1980-1990
 [Ans. (b) 1971-1980]

orders@surabooks.com PH: 9600175757 / 8124201000 / 8124301000


This is only for Sample Materials
for Full Book order online and available at all Leading Bookstores
Sura’s  XI Std - Computer Science ➠ Introduction to Computers 13

13. Every task given to a computer-follows a(n) 22. Expansion of CPS is ...................... .
............... cycle. (a) Character Per Second (b) Copy Per Second
(a) BPO (b) IPO (c) Code Per Second (d) Character Per Screen
(c) ANN (d) NLP [Ans. (b) IPO]  [Ans. (a) Character Per Second]
14. Expansion of CPU is .................. . 23. The first computer monitor was released in the

m
(a) Control processing unit year .................. .
(b) Central processor unique (a) 1980 (b) 1983 (c) 1963 (d) 1973
(c) Central processing unit  [Ans. (d) 1973]

co
(d) Control processor unit 24. The expansion of VLSI is
 [Ans. (c) Central processing unit] (a) Verified Logical Scale Integrated Circuits
15. Expansion of ALU is .................... . (b) Very Logical Small Integer Circuits
(c) Very Large Scale Integrated Circuits
(a) Arithmetic Logical Unit
(d) Volatile Large Scale Integrated Circuits

s.
(b) Accumulator Logical Unit  [Ans. (c) Very Large Scale Integrated Circuits]
(c) Arithmetic Language Unit 25. The first digital computer name was ............. .
(d) None of these (a) EDVAC (b) UNIVACI

ok
 [Ans. (a) Arithmetic Logical Unit] (c) ENIAC (d) IBM 1620
 [Ans. (c) ENIAC]
16. The memory unit is of .............. kinds.
(a) 3 (b) 4 (c) 2 (d) 5 26. Artificial neurons are organized in ....... .
 [Ans. (c) 2] (a) Nodes (b) Layers
o (c) Signals (d) Units
17. I dentify the Input device  [FMT 2018]
 [Ans. (b) Layers]
ab
(a) Printer (b) Mouse
(c) Plotter (d) Projector 27. The conversion of data to information is called
 [Ans. (b) Mouse] ........... .
(a) Data Digitization
18. Optical Mouse invented in the year.
(b) Data Processing
ur

(a) 1968 (b) 1973 (c) 1988 (d) 1981 (b) Data Management
 [Ans. (c) 1988] (d) All of these
19. Laser mouse has as many as ............... buttons.  [Ans. (b) Data Processing]
.s

(a) 10 (b) 11 (c) 12 (d) 3 28. A set of instructions given to the computer is
 [Ans. (c) 12] called ............. .
20. Expansion of CCD is ................. (a) Information (b) Data
w

(a) Coupled Changed Device (c) Input (d) Program


 [Ans. (d) Program]
(b) Changed Coupled Device
w

(c) Changed Couple Device 29. The mechanical mouse introduced in the year.
(d) Camera changed Divider (a) 1978 (b) 1988 (c) 1968 (d) 1958
 [Ans. (c) 1968]
 [Ans. (b) Changed Coupled Device]
w

30. T
 he Red, Green or Blue led used mouse in
21. Expansion of GUI is .............. .  [QY. 2018]
invented by .................
(a) Graphics User Interface
(a) John Mauchly (b) Steve Kirsch
(b) Graphical User Information (c) Henry babbaje (d) Presper Eckert
(c) Geographical User Information  [Ans. (b) Steve Kirsch]
(d) Graphical User Interface
 [Ans. (d) Graphical User Interface]

orders@surabooks.com PH: 9600175757 / 8124201000 / 8124301000


This is only for Sample Materials
for Full Book order online and available at all Leading Bookstores
14 Sura’s  XI Std - Computer Science ➠ Volume I ➠ Unit I ➠ Chapter 1
31. W
 ho assisted Douglas Engelbart to invent the 40. The first compute Monitor was released in the
mouse? year ..............
(a) Berry (b) Steve Kirsch (a) 1974 (b) 1972 (c) 1971 (d) 1973
(c) Bill English (d) Bill Gates  [Ans. (d) 1973]
 [Ans. (c) Bill English]
41. The expansion of VGA is ..............

m
32. W
 hich device is used to enter information directly
into the computer's memory? (a) Visual Graphics Adapter
(a) Keyboard (b) Scanner (b) Video Graphics Adapter

co
(c) Mouse (d) Plotter (c) Video Graphics Array
 [Ans. (b) Scanner] (d) Voice Graphics Array
33. The expansion of USB is ................  [Ans. (c) Video Graphics Array]
(a) Universal Serial Bus
42. Which of the following is an impact priners

s.
(b) Uniform Serial Bus
(c) Uniform Serious Bus (a) Inkjet (b) Fax
(d) Universal Serial BIOS (c) Dot Matrix (d) Laser
 [Ans. (a) Universal Serial Bus]

ok
34. Which device used CCD chip?  [Ans. (c) Dot Matrix]
(a) Light pen (b) Scanner 43. An error will half the boot process found in ..........
(c) Microphone (d) Digital Camera (a) BIOS (b) POST
 [Ans. (d) Digital Camera]
o
35. Which device is used to input by pressing one or
(c) HDD

(d) I/O System
[Ans. (b) POST]
more switches?
ab
(a) Keyboard (b) Mouse 44. T
 he process of loading an OS in a computer RAM
(c) Touch Screen (d) Keyer is known as ............
 [Ans. (d) Keyer] (a) POST (b) BIOS
36. How many types of monitors are there? (c) Booting (d) All of these
ur

(a) 2 (b) 3 (c) 4 (d) Many  [Ans. (c) Booting]


 [Ans. (b) 3]
37. The expansion of CRT is ................
(a) Cathode Ray Tube IV. Pick the Odd one Out.
.s

(b) Cathode Radio Tube


(c) Cathode Ray Technology 1. (a) Keyboard (b) Mouse
(d) Cathode Radio Technology (c) Track Ball (d) Monitor
w

 [Ans. (a) Cathode Ray Tube]


[Ans. (d) Monitor]
38. The expansion of LCD is ..............
(a) Liquid Cathode Diodes Reason : Monitor is the most commonly used output
w

(b) Liquid Cluster Display device to display the information. Other three are
(c) Liquid Crytal Display examples of input device.
(d) Live Extract Display 2. (a) Mechanical Mouse (b) Laser Mouse
w

 [Ans. (b) Liquid Cluster Display]


39. The expansion of LED is ............... (c) Plotter (d) Optical Mouse
(a) Light Extract Display [Ans. (c) Plotter]
(b) Light Emitting Diodes Reason : Plotter is an output device that is used to
(c) Liquid Emitting Diodes produce graphical output on papers other three are
(d) Liquid Extract Display types of mouse.
 [Ans. (c) Liquid Emitting Diodes]

orders@surabooks.com PH: 9600175757 / 8124201000 / 8124301000


This is only for Sample Materials
for Full Book order online and available at all Leading Bookstores
Sura’s  XI Std - Computer Science ➠ Introduction to Computers 15

V. Which one of the Following is Not 3. Assertion (A) :  icrophone serves as a voice
M
Correctly Matched? Input device.
Reason (R) : Digital camera uses a CCD
1. (a) Impact printers – Dot Matrix printer electronic chip.
(b) Non–Impact printers – Laser printer (a) Both (A) and (R) are true and (R) is the correct

m
(c) Hardware – Keyboard explanation of (A).
(d) Software – CPU (b) Both (A) and (R) are true and (R) is not the
correct explanation of (A).
[Ans. (d) Software – CPU]
(c) (A) is true, but (R) is false.

co
2. (a) Second generation – Transistors (d) (A) is false, but (R) is true.
(b) Third generation – Integrated circuits [Ans. (b) Both (A) and (R) are true and (R) is not
(c) Fourth generation – Vacuum tubes the correct explanation of (A)]
(d) Fifth generation – ULSI

s.
[Ans. (c) Fourth generation – Vacuum tubes] VII. Choose the Correct Statement.

VI. Consider the Following Statement. 1. Which of the following statements are true?

ok
(i) Machine language programs are done in first
1. Assertion (A) : Computers have now become an generation
indispensable part of our lives. (ii) Third generation computers are not more reliable
Reason (R) : Computers have revolutionized (iii) Voice recognition software developed in fifth
o
out lives with their accuracy and generation computer
speed of performing a job, it is (iv) Micro processors are used in fourth generation
ab
truly remarkable. computer
(a) Both (A) and (R) are true and (R) is the correct (a) Only (i) (b) Only (i) and (iv)
explanation of A. (c) Only (iii) and (iv) (d) Only (i) (iii) and (iv)
(b) Both (A) and (R) are true and (R) is not the  [Ans. (b) Only (i) and (iv)]
correct explanation of (A).
ur

(c) (A) is true, but (R) is false. Very Short Answers 2 MARKS
(d) (A) is false, but (R) is true.
1. Name the first generation computers.
[Ans. (a) Both (A) and (R) are true and (R) is the
.s

Ans. ENIAC, EDVAC, UNIVAC 1.


correct explanation of (A)]
2. Name the Second generation computers.
2. Assertion (A) : PU is the major component
C
which interprets and executes Ans. IBM 1401, IBM 1620, UNIVAC 1108.
w

software instructions. 3. Name the Third generation computers.


Reason (R) : The ALU is a part of the CPU Ans. IBM 360 Series, Honeywell 6000 series.
where various computing
w

functions are performed on data. 4. Expand (i)BIOS (ii)ENIAC (iii)RAM (iv)ALU


(a) Both (A) and (R) are true and (R) is the correct  [Govt.MQP-2018]
explanation of A. Ans. (i) BIOS - Basic Input Output System.
w

(b) Both (A) and (R) are true and (R) is not the (ii) ENIAC - Electronic Numerical Integrator
correct explanation of A. And Calculator.
(c) (A) is true, but (R) is false. (iii) RAM - Random Access Memory
(d) (A) is false, but (R) is true. (iv) ALU - Arithmetic and Logic unit
[Ans. (b) Both (A) and (R) are true and (R) is not
the correct explanation of (A)]

orders@surabooks.com PH: 9600175757 / 8124201000 / 8124301000


This is only for Sample Materials
for Full Book order online and available at all Leading Bookstores
16 Sura’s  XI Std - Computer Science ➠ Volume I ➠ Unit I ➠ Chapter 1
5. Name the softwares introduced in fifth generation 14. What is use of VGA?
computers. Ans. The screen monitor works with the VGA (Video
Ans. (i) Artificial Intelligence Graphics Array). The video graphics card helps the
(ii) Expert Systems keyboard to communicate with the screen. It acts as an
6. Give examples for Impact and Non impact interface between the computer and display monitor.

m
printers. [FMT 2018] Usually the recent motherboard incorporates built in
Ans. Impact : Dot Matrix printer and line dot matrix printer. video card.
Non - Imapct : Laser printer and Inkjet printer.
15. Write the two main categories of Printer.

co
7. Name the types of computer introduced in Fourth
Ans. Printers are divided into two main categories:
generation computers.
Ans. (i) Microcomputer (i) Impact Printers
(ii) Portal Computers. (ii) Non Impact printers

s.
8. Write the developments of Sixth generation
16. What is booting a computer?
computers.
Ans. (i) Parallel Computing Ans. Booting a computer is to load an operating system

ok
(ii) Artificial Neural Networks into the computer's main memory or random access
(iii) Robotics memory (RAM).
(iv) Natural Language Processing
17. What makes Charles Babbage the father of
9. What is NLP? computing?
o
Ans. Natural Language Processing is the ability of a
Ans. Charles Babbage radical ideas and concept of the
computer program to understand human language. It
ab
Analytical Engine (It contained an ALU, basic flow
is a component of artificial intelligence. control and integrated memory) makes him the father
10. Write short note on registers.  [FMT 2018] of computing.
Ans. Registers are the high-speed temporary storage 18. What is the goal of neural network approach?
ur

locations in the CPU. Hence, their contents can be Ans. The original goal of the neural network approach was
handled much faster than the contents of memory. to solve problems in the same way that a human brain
11. What is the use of Microphone? would. Over time, attention focused on matching
.s

Ans. Microphone serves as a voice Input device. It specific mental abilities, leading to deviations from
captures the voice data and send it to the Computer. biology.

12. Write a note on Digital Camera. 19. Write the tools in which nano technology was
w

Ans. It captures images / videos directly in the digital form. born.


It uses a CCD (Charge Coupled Device) electronic Ans. The right tools, such as the scanning tunneling
microscope (STM) and the atomic force microscope
w

chip. When light falls on the chip through the lens, it


converts light rays into digital format. (AFM), the age of nano-technology was born.

13. Write Demerits of Artificial Intelligence.  [QY. 2018] 20. Define IPO Cycle.
w

Ans. (i) Machines need repairing and maintenance Ans. The functional components of a computer performs.
which need plenty of cost. Every task given to a computer follows an Input-
(ii) The increasing number of machines leading to Process- Output Cycle (IPO cycle).
unemployment and job security issues.

orders@surabooks.com PH: 9600175757 / 8124201000 / 8124301000


This is only for Sample Materials
for Full Book order online and available at all Leading Bookstores
Sura’s  XI Std - Computer Science ➠ Introduction to Computers 17

21. Name the different keys available in the keyboard. 29. What does reboot mean?
Ans. There are different set of keys available in the Ans. It means to reload the operating system.
keyboard such as character keys, modifier keys,
30. Write the limitations of impact printer.
system and GUI keys, enter and editing keys,
Ans. (1) It is slow as compared to non-impact printers
function keys, navigation keys, numeric keypad and

m
(2) It is not best suited for graphics
lock keys.
(3) It is not possible to obtain colour output.
22. Which device is used to draw a lines?
Ans. Light Pen is an input device which is used to draw Short Answers 3 MARKS

co
lines or figures on a computer screen. It is touched
1. Write a note Vaccum tube.
to the CRT screen where it can detect faster on the
screen as it passes. Ans. (i) Vacuum tubes contain electrodes for controlling
electron flow and were used in early computers

s.
23. Define Pixels. as a switch or an amplifier.
Ans. Pictures on a monitor are formed with picture (ii) Vaccum tubes are big in size and consumed
elements called PIXELS. more power.

ok
24. Name the types of Monitors available. 2. Define Transistor.
Ans. The types of monitors available such as CRT Ans. (i) The transistor ("transfer resistance") is made up
(Cathode Ray Tube), LCD (Liquid Crystal Display) of semi-conductors.
and LED (Light Emitting Diodes).
o (ii) It is a component used to control the amount
25. How the date travel through control bus? of current or voltage used for amplification/
ab
Ans. The date travel in both unidirectional and modulation or switching of an electronic signal.
bidirectional due to the internal connection with in 3. Define Punched cards.
the computer architecture. Ans. Punch cards also known as Hollerith cards are paper
26. Name the type of registers are essential for cards containing several punched or perforated holes
ur

instruction execution. that were punched by hand or machine to represent


Ans. (i) Program counter data.

(ii) Instruction Register 4. Differentiate Impact Printers and Non-Impact


.s

Printers.
(iii) Memory Address Registers
Ans. Impact Printers Non-Impact Printers
(iv) Memory Buffer Register
It uses ribbons / carbon It use ink cartridges and
w

(v) Accumulator papers to leave the the impressions appear on


impressions on the the paper with the flow
27. Expand (a) MAR (b) MBR paper. of ink.
w

Ans. (a) MAR - Memory Address Register The quality of printing is The quality of printing is
a draft quality. a high quality.
(b) MBR - Memory Buffer Register Striking Mechanism No striking mechanism
used to produce output. used to produce output.
w

28. Why POST is essential?


Ans. If the hardware is not detected, a particular pattern
of beeps will inform about the error. An error
found in the POST is usually fatal (that is, it causes
current program to stop running) and will halt the
boot process, since the hardware check is absolutely
essential for the computer's functions.

orders@surabooks.com PH: 9600175757 / 8124201000 / 8124301000


This is only for Sample Materials
for Full Book order online and available at all Leading Bookstores
18 Sura’s  XI Std - Computer Science ➠ Volume I ➠ Unit I ➠ Chapter 1
5. Differentiate Dot Matrix Printer and Laser (ii) Laser mouse uses laser light.
Printer. (iii) 
Laser mouse is highly sensitive and able to
work on any hard surface.
Ans. Dot Matrix Printer Laser Printer
Printing speed is slow. Printing speed is high. 12. Write the sequence of steps in boot process? (or)
Suitable for black and Suitable of colour Explain the types of booting in computer.

m
white printing. printing.  [Govt.MQP, FMT-2018]
It makes noise while It is silent while printing. Ans. Booting process is of two types.
printing. (i) Cold Booting (ii) Warm Booting

co
6. What is Machine language? (i) Cold Booting: When the system starts from
initial state i.e. it is switched on, we call it cold
Ans. (i) Machine language is a collection of binary digits
booting or Hard Booting. When the user presses
or bits that the computer reads and interprets.
the Power button, the instructions are read from
(ii) In first generation, machined language was the ROM to initiate the booting process.

s.
used. (ii) Warm Booting: When the system restarts or
7. What is Integrated circuits? when Reset button is pressed, we call it Warm

ok
Ans. (i) IC is short for Integrated Circuit or Integrated Booting or Soft Booting. The system does not
start from initial state and so all diagnostic tests
Chip.
need not be carried out in this case. There are
(ii) The IC is a package containing many circuits,
pathways, transistors, and other electronic
o chances of data loss and system damage as the
components all working together to perform a data might not have been stored properly.
particular function or a series of functions. Differentiate optical mouse and laser mouse.
ab
13. Write a note on Touch Screen.
8. What is Robotics?
Ans. (i) A touch screen is a display device that allows
Ans. (i) Robot is a term coined by Karel Capek in the the user to interact with a computer by using the
1921 play RUR (Rossum's Universal Robots). finger.
(ii) It is used to describe a computerized machine (ii) It can be quite useful as an alternative to a
ur

mouse or keyboard for navigating a Graphical


designed to respond to input received manually
User Interface (GUI).
or from its surroundings.
(iii) Touch screens are used on a wide variety of
9. What is Nano-technology? devices such as computers, laptops, monitors,
.s

smart phones, tablets, cash registers, and


Ans. Nano-technology, is an engineering, science, and information kiosks.
technology that develops machines or works with (iv) Some touch screens use a grid of infrared beams
one atom or one molecule that is 100 nanometers or
w

to sense the presence of a finger instead of


smaller. utilizing touch-sensitive input.
10. How Finger Print Scanner Working? [QY. 2018]
14. Define POST.
w

Ans. Finger print Scanner: Fingerprint Scanners is a


Ans. (i) POST (Power-On Self-Test) is the diagnostic
fingerprint recognition device used for computer
security, equipped with the fingerprint recognition testing sequence that a computer's basic input/
w

feature that uses biometric technology. Fingerprint output system runs to determine if the computer
Reader / Scanner is very safe and convenient device keyboard, random access memory, disk drives
for security instead of password, that is vulnerable to and other hardware are working correctly.
fraud and is hard to remember.
(ii) If the necessary hardware is detected and found
11. Write the mechanism of laser mouse. [FMT 2018] to be operating properly, the computer begins to
Ans. (i) Measures the motion and acceleration of pointer. boot.

orders@surabooks.com PH: 9600175757 / 8124201000 / 8124301000


This is only for Sample Materials
for Full Book order online and available at all Leading Bookstores
Sura’s  XI Std - Computer Science ➠ Introduction to Computers 19

Long Answers 5 MARKS Optical mouse has three buttons.Optical mouse


is less sensitive towards surface.
1. Explain any two input and output devices.
(iii) Laser Mouse: 
Ans. Input Devices :
Measures the motion and acceleration of pointer.
(i) Scanner: Scanners are used to enter the Laser Mouse uses Laser Light. Laser Mouse is

m
information directly into the computer’s memory. highly sensitive and able to work on any hard
This device works like a xerox machine. The surface.
scanner converts any type of printed or written
information including photographs into a digital 3. Short answer on the following:  [QY. 2018]

co
format, which can be manipulated by the computer. a) Data b) Hardware
c) Natural Language Processing
(ii) Finger print Scanner: Finger print Scanner is a
d) Types of Memory
fingerprint recognition device used for computer
e) Bit

s.
security, equipped with the fingerprint recognition
feature that uses biometric technology. Fingerprint Ans. (a) Data : The term data comes from the word
Reader / Scanner is a very safe and convenient datum, which means a raw fact. The data is a

ok
device for security instead of using passwords, fact about people, places or some objects.
which is vulnerable to fraud and is hard to (b) Hardware : Hardware is the physical
remember. component of a computer like motherboard,
memory devices, monitor, keyboard etc.,
Output Devices :
o (c) Natural Language Processing : Natural
(i) Monitor: Monitor is the most commonly Language Processing is a method used in
ab
used output device to display the information. artificial intelligence to process and derive
It looks like a TV. Monitors may either be meaning from the human language.
Monochrome which display text or images in (d) Types of Memory : The memory unit is of two
Black and White or can be color, which display types - Primary memory, Secondary memory.
results in multiple colors. There are many types
ur

(e) Bit : Machine language is a collection of


of monitors available such as CRT (Cathode Ray
Tube), LCD (Liquid Crystal Display) and LED binary digits or bits that the computer reads and
(Light Emitting Diodes). The video graphics interprets.
.s

card helps the keyboard to communicate with


the screen. It acts as an interface between the 4. Explain Impact Printers with an Example.
computer and display monitor. Ans. Impact Printers : 
w

(ii) Plotter: Plotter is an output device that is used to (i) These printers print with striking of hammers
produce graphical output on papers. It uses single or pins on ribbon. These printers can print
color or multi color pens to draw pictures. on multi-part (using carbon papers) by using
mechanical pressure.
w

2. Explain in detail the different types of Mouse. (ii) For example, Dot Matrix printers and Line
Ans. (i) Mechanical Mouse : A small ball is kept inside matrix printers are impact printers.
and touches the pad through a hole at the bottom (iii) A Dot matrix printer that prints using a fixed
w

of the mouse. When the mouse is moved, the ball number of pins or wires. Each dot is produced
rolls. This movement of the ball is converted by a tiny metal rod, also called a “wire” or
into signals and sent to the computer. “pin”, which works by the power of a tiny
(ii) Optical Mouse: Measures the motion and electromagnet or solenoid, either directly or
acceleration of pointer. It uses light source through a set of small levers.
instead of ball to judge the motion of the pointer.

orders@surabooks.com PH: 9600175757 / 8124201000 / 8124301000


This is only for Sample Materials
for Full Book order online and available at all Leading Bookstores
20 Sura’s  XI Std - Computer Science ➠ Volume I ➠ Unit I ➠ Chapter 1
(iv) It generally prints one line of text at a time. The Inkjet Printers:
printing speed of these printers varies from 30 (i) Inkjet Printers use colour cartridges which
to 1550 CPS (Character Per Second). combined Magenta, Yellow and Cyan inks to
create color tones.
5. Explain Non-Impact printers with an examples.
(ii) A black cartridge is also used for monochrome
Ans. Non-Impact Printers : 

m
output. Inkjet printers work by spraying ionised
(i) These printers do not use striking mechanism
ink at a sheet of paper.
for printing. They use electrostatic or laser
technology. (iii) They use the technology of firing ink by heating
it so that it explodes towards the paper in

co
(ii) Quality and speed of these printers are better
than Impact printers. For example, Laser bubbles or by using piezoelectricity in which
printers and Inkjet printers are non-impact tiny electric currents controlled by electronic
printers. circuits are used inside the printer to spread ink
in jet speed.
Laser Printers :

s.
(iv) An Inkjet printer can spread millions of dots of
(i) Laser printers mostly work with similar
ink at the paper every single second.
technology used by photocopiers.
(ii) It makes a laser beam scan back and forth across

ok
a drum inside the printer, building up a pattern.
It can produce very good quality of graphic
images. o 
ab
ur
.s
w
w
w

orders@surabooks.com PH: 9600175757 / 8124201000 / 8124301000


This is only for Sample Materials
for Full Book order online and available at all Leading Bookstores

Chapter
2 Number Systems

m
co
CHAPTER SNAPSHOT
 2.1 Number Systems - Introduction 2.4.12 Hexadecimal to Binary

s.
 2.2 Data Representations Conversion
 2.3 Different Types of Number Systems  2.5  Binary Representation for Signed
Numbers

ok
2.3.1 Decimal Number System
2.3.2 Binary Number System 2.5.1 Signed Magnitude representation

2.3.3 Octal Number System 2.5.2 1’s Complement representation

2.3.4 Hexadecimal Number System 2.5.3 2’s Complement representation

 2.4
o
Number System Conversions  2.6 Binary Arithmetic
2.6.1 Binary Addition
ab
2.4.1 Decimal to Binary Conversion
2.4.2 Decimal to Octal Conversion 2.6.2 Binary Subtraction

2.4.3 Decimal to Hexadecimal Conversion  2.7 Representing Characters in


Memory
2.4.4 Conversion of fractional Decimal to
ur

Binary 2.7.1 Binary Coded Decimal (BCD)

2.4.5 Binary to Decimal Conversion 2.7.2 American Standard Code for


Information Interchange (ASCII)
2.4.6 Binary to Octal Conversion
.s

2.7.3 Extended Binary Coded Decimal


2.4.7. Binary to Hexadecimal Conversion
Interchange Code (EBCDIC)
2.4.8 Conversion of fractional Binary to
w

2.7.4 Indian Standard Code for


Decimal equivalent
Information Interchange (ISCII)
2.4.9. Octal to Decimal Conversion
2.7.5 Unicode
w

2.4.10 Octal to Binary Conversion


 2.8. Boolean Algebra - Introduction
2.4.11 Hexadecimal to Decimal Conversion
 2.9. Basic Logic Gates
w

[21]

orders@surabooks.com PH: 9600175757 / 8124201000 / 8124301000


This is only for Sample Materials
for Full Book order online and available at all Leading Bookstores

m
co
s.
COMPUTER SCIENCE o ok
ab

VOLUME - II
ur
.s
w
w
w

[129]

orders@surabooks.com PH: 9600175757 / 8124201000 / 8124301000


This is only for Sample Materials
for Full Book order online and available at all Leading Bookstores

Contents

m
co
Chapter P. No

s.
No
Title

UNIT III - INTRODUCTION TO C++

ok
9. Introduction to C++ 129-166
10. Flow of Control 167-186
11. Functions 187-206
12. Arrays and Structures
o 207-227
UNIT IV - OBJECT ORIENTED PROGRAMMING WITH C++
ab
13. Introduction to Object Oriented Programming Techniques 228-235
14. Classes and objects 236-265
15. Polymorphism 266-277
ur

16. Inheritance 278-303


UNIT V – COMPUTER ETHICS AND CYBER SECURITY
17. Computer Ethics and Cyber Security 304-314
.s

18. Tamil Computing 315-318

Govt. Model Question Paper & Sura’s Model Question Paper 1 - 3 with Answer Key. 319-339
w

March 2019 Question Paper with Answer Key. 340-348


w
w

[130]

orders@surabooks.com PH: 9600175757 / 8124201000 / 8124301000


This is only for Sample Materials
for Full Book order online and available at all Leading Bookstores

UNIT- III INTRODUCTION TO C++

m
Chapter
9I C++

co
ntroduction to

s.
CHAPTER SNAPSHOT

ok
 9.1. Introduction 9.7.2. Working with Dev C++
 9.2. Character set  9.8. Types of Errors
 9.3. Lexical Units (Tokens)
o Data Types, Variables and Expressions
9.3.1. Keywords  9.10. Introduction
9.3.2. Identifiers  9.11. Concept of Data types
ab
9.3.3. Literals(Constants)  9.12. C++ Data types
9.3.4. Operators 9.12.1. Introduction to
9.3.5. Punctuators fundamental Data types
ur

9.3.6. Lexic 9.12.2. Memory representation of


 9.4. I/O Operators Fundamental Data types

9.4.1. Input Operator 9.12.3. Data type modifiers


.s

9.4.2. Output Operator  9.13. Variables

9.4.3. Cascading if I/O Operators 9.13.1. Declaration of Variables


9.13.2. Initialization of variables
w

 9.5.  ample Program - A first


S
look at C ++ program 9.13.3. Dynamic Initialization
 9.6. Execution of C++ program 9.13.4. The Access modifier const..
w

 9.7. C++ Development 9.13.5. References


Environment  9.14. Formatting Output
w

9.7.1. Familiar C++ Compilers  9.15. Expression


with IDE  9.16. Type Conversion

[131]

orders@surabooks.com PH: 9600175757 / 8124201000 / 8124301000


This is only for Sample Materials
for Full Book order online and available at all Leading Bookstores
132 Sura’s  XI Std - Computer Science ➠ Volume II ➠ Unit III ➠ Chapter 9

Evaluation
Part - I 8. A program written in high level language is called
as?
Choose the Correct Answer: (a) Object code (b) Source code

m
1. Who developed C++? (c) Executable code (d) All the above
(a) Charles Babbage (b) Bjarne Stroustrup  [Ans. (b) Source code]
(c) Bill Gates (d) Sundar Pichai 9. Assume a=5, b=6; what will be result of a&b?

co
 [Ans. (b) Bjarne Stroustrup] (a) 4 (b) 5
2. What was the original name given to C++? (c) 1 (d) 0
(a) CPP (b) Advanced C  [Ans. (a) 4]
(c) C with Classes (d) Class with C

s.
10. Which of the following are called as compile time
 [Ans. (c) C with Classes] operators?
3. Who coined C++? (a) sizeof (b) pointer

ok
(a) Rick Mascitti (b) Rick Bjarne (c) virtual (d) this
(c) Bill Gates (d) Dennis Ritchie  [Ans. (a) sizeof]
 [Ans. (a) Rick Mascitti]
Part - II
4. The smallest individual unit in a program is:
Answer to All the questions : (2 Marks)
(a) Program
o
(b) Algorithm
(c) Flowchart (d) Tokens 1. What is meant by a token? Name the token
ab
 [Ans. (d) Tokens] available in C++
5. Which of the following operator is extraction Ans. The smallest individual unit in a program is known
operator in C++? as a Token or a Lexical unit.
(a) >> (b) << C++ has the following tokens:
ur

(c) <> (d) ^^ (i) Keywords


 [Ans. (a) >>] (ii) Identifiers
6. Which of the following statement is not true? (iii) Literals
.s

(a) Keywords are the reserved words convey specific (iv) Operators
meaning to the C++ compiler (v) Punctuators
(b) Reserved words or keywords can be used as an
2. What are keywords? Can keywords be used as
w

identifier name
(c) An integer constant must have at least one digit identifiers?
without a decimal point. Ans. Keywords are the reserved words which convey
(d) Exponent form of real constants consists of two specific meaning to the C++ compiler. They are the
w

parts essential elements to construct C++ programs. No,


 [Ans. (b) Reserved words or keywords can be Keywords cannot be used as an identifier.
used as an identifier name] 3. The following constants are of which type?
w

7. Which of the following is a valid string literal? (i) 39 (ii) 032 (iii) OXCAFE (iv) 04.14
(a) 'A' (b) 'Welcome' Ans. (i) Integer constant
(c) 1232 (d) "1232" (ii) Octal constant
 [Ans. (d) "1232"] (iii) Hexadecimal constant
(iv) Floating point constant.

orders@surabooks.com PH: 9600175757 / 8124201000 / 8124301000


This is only for Sample Materials
for Full Book order online and available at all Leading Bookstores
Sura’s  XI Std - Computer Science ➠ Introduction to C++ 133

4. Write the following real constants into the 3. Differentiate “=” and "==”
exponent form:
Ans. = ==
(i) 23.197 (ii) 7.214 (iii) 0.00005 (iv) 0.319
(i) It is an assignment It is a relational
Ans. (i) 0.23197 ×102 ⇒ 0.23197E02 operator. operator.
(ii) 0.7214 ×101 ⇒ 0.7214E01 (ii) It is used to assign

m
It is used to
(iii) 0.5 ×10–4 ⇒ 0.5E.04 a value to a variable compare two values
which is on the and the result will
(iv) 0.0319 ×101 ⇒ 0.0319E01.
left hand side of be either true or

co
5. Assume n=10; what will be result of n>>2;? an assignment false.
statement.
Ans. n = 10 ⇒ (00001010)2
(iii) Eg: a = b Eg: a = = b
n >> 2 ⇒ (00000010)2⇒ 210
(b value is assigned (a value will be

s.
6. Match the following: to a) compared with b
value)
A B
4. Assume a=10, b=15; What will be the value of
(a) Modulus (1) Tokens

ok
a^b?
(b) Separators (2) Remainder of a
Ans. a ^ b
division
10 ^ 15
(c) Stream extraction (3) Punctuators
1010 = 10102
(d) Lexical Units (4) get from
o 1510 = 11112
 [Ans. (a) - (2), (b)- (3), (c) - (4), (d) - (1)] 10 1 0 1 0
ab
15 1 1 1 1
Part - III a^B 0 1 0 1
Answer to All the questions :(3 Marks)
a^b = 01012 = 510
ur

1. Describe the differences between keywords and


identifiers? 5. What is the difference between “Run time error”
and “Syntax error”?
Ans. Keywords Identifiers
Ans. Syntax error Run-time error
.s

Keywords are the Identifiers are the user


reserved words which defined names given (i) Syntax is a set of A run time error is
convey specific to different parts of the grammatical rules to that occurs during
meaning to the C++. C++ program. Identifiers construct a program. the execution of a
w

Keywords can not be are not reserved. program.


used as an identifier. (ii) Syntax errors occur It is occurs because
Example: Example: when grammatical of some illegal
w

Switch, case, for, if name, age, class-12B rules of C++ are operation that takes
etc., etc., violated. place.
(iii) Example: if a Example: if a
w

2. Is C++ case sensitive? What is meant by the term program tries to open program tries to
"case sensitive"? a file which does not open a file which
exist, it results in a does not exist, it
Ans. Yes, C++ is case sensitive. Case sensitive means C++
run time error. results in a run time
treats upper and lower case characters differently. error.
Capital letters ≠ small letters.

orders@surabooks.com PH: 9600175757 / 8124201000 / 8124301000


This is only for Sample Materials
for Full Book order online and available at all Leading Bookstores
134 Sura’s  XI Std - Computer Science ➠ Volume II ➠ Unit III ➠ Chapter 9
6. What are the difference between “Logical error” Part - IV
and “Syntax error”?  [HF. 2018]
Answer to All the Questions: (5 Marks)
Ans. Syntax error Logical error 1. Write about Binary operators used in C++.
(i) Syntax is a set of A Program has not Ans. Binary Operators - Require two operands [HF. 2018]
grammatical rules to produced expected (i) Arithmetic Operators

m
construct a program. result even though (ii) Relational Operators
the program is
grammatically (iii) Logical Operators
correct. It may be (iv) Bitwise Operators
happened by wrong

co
use of variable / (v) Assignment Operators
operator / order of (vi) Conditional Operator
execution etc. (i) Arithmetic Operators : Arithmetic operators
(ii) Every programming This means, program perform simple arithmetic operations like
language has is grammatically

s.
addition, subtraction, multiplication, division etc.,
unique rules for correct, but it
contains some (ii) Relational Operators : Relational operators
constructing the logical error. are used to determine the relationship between
source code. its operands. When the relational operators are

ok
(iii) Syntax errors occur Semantic error is applied on two operands, the result will be a
when grammatical also called as "Logic Boolean value i.e 1 or 0 to represents True or
rules of C++ are Error".
False respectively. C++ provides six relational
violated. o operators.
7. What is the use of a header file? (iii) Logical Operators : A logical operator is used
Ans. Header files contain definitions of functions and to evaluate logical and relational expressions.
ab
variables, which is used into any C++ program by The logical operators act upon the operands that
using the pre-processor #include statement. It have are themselves called as logical expressions.
an extension ".h" which contains C++ function C++ provides three logical operators.
declaration and macro definitions. (iv) Bitwise Operators : Bitwise operators work
on each bit of data and perform bit-by-bit
ur

8. Why is main function special?


operation. In C++, there are three kinds of
Ans. C++ program is a collection of functions. Every C++
bitwise operators, which are:
program must have a main function. The main( )
function is the starting point where all C++ programs (1) Logical bitwise operators
(2) Bitwise shift operators
.s

being their execution. Therefore, the executable


statements should be inside the main ( ) function. (3) One’s complement operators
9. Write two advantages of using include compiler (v) Assignment Operators : Assignment operator
is used to assign a value to a variable which
w

directive.
Ans. The preprocessor directive # include tells the
is on the left hand side of an assignment
computer to insert another file in to the source file. statement. = (equal to) is commonly used
as the assignment operator in all computer
w

The two advantages are


programming languages. This operator copies
(i) The program is broken down into modules thus
the value at the right side of the operator to the
making it more simplified
left side variable. It is also a binary operator.
(ii) More library functions can be used at the same
w

(vi) Conditional Operators : In C++, there is


time size of the program is retained.
only one conditional operator is used. ?: is a
10. Write the following in real constants. conditional Operator. This is a Ternary Operator.
(i) 15.223 (ii) 211.05 (iii) 0.00025 This operator is used as an alternate to if … else
Ans. (i) 1.5223 ×101 ⇒ 1.5223E – 1 control statement.
(ii) 2.1105 ×102 ⇒ 2.1105E – 2
(iii) 25 ×10–5 ⇒ 25E - 5
orders@surabooks.com PH: 9600175757 / 8124201000 / 8124301000
This is only for Sample Materials
for Full Book order online and available at all Leading Bookstores
Sura’s  XI Std - Computer Science ➠ Introduction to C++ 135

2. What are the types of Errors?


Evaluate Yourself
Ans. Type of Error Description
1. What is meant by literals? How many types of
Syntax Error Syntax is a set of
grammatical rules to integer literals available in C++?
construct a program. Every Ans. (i) Literals are data items whose values do not

m
programming language change during the execution of a program.
has unique rules for Therefore Literals are called as Constants.
constructing the source
code. (ii) Three types of integer 1. Decimal 2. Octal

co
Syntax errors occur when 3. Hexadecimal
grammatical rules of C++
are violated. 2. What kind of constants are following?
Example: If you type as (i) 26 (ii) 015 (iii) 0xF (iv) 014.9
follows, C++ will throw an

s.
Ans. (i) Integer
error. cout <<"Welcome
to Programming in C++" (ii) Octal
As per grammatical rules (iii) Hexadecimal
of C++, every executable

ok
(iv) Floating
statement should terminate
with a semicolon. But, this 3. What is character constant in C++?
statement does not end with Ans. A character constant in C++ must contain one
a semicolon.
character and must be enclosed in a single quote.
Semantic Error
o
A Program has not produced
expected result even though Valid character constants : 'A', '2', '$'
the program is grammatically 4. How are non graphic characters represented in
ab
correct. It may be happened C++?
by wrong use of variable/
Ans. Non- printable characters can be represented by using
operator /order of execution
etc. This means, program is escape sequences. An escape sequence is represented
grammatically correct, but it by a backslash followed by one or two characters.
ur

contains some logical error. 5. Write the following real constants into exponent
So, Semantic error is also
form:
called as "Logic Error".
(i) 32.179 (ii) 8.124 (iii) 0.00007
Run-time error A run time error is that
.s

occurs during the execution Ans. (i) 32179E –3


of a program. It is occurs (ii) 8124E – 3
because of some illegal
operation that takes place. (iii) 7E – 5
w

For example, if a program 6. Write the following real constants into fractional
tries to open a file which
does not exist, it results in a form:
run-time error. (i) 0.23E4 (ii) 0.517E-3 (iii) 0.5E-5
w

3. Assume a=15, b=20; What will be the result of the Ans. (i) 0.000023
following operations? (ii) 0.000517
(a) a&b (b) a|b (c) a^b (d) a>>3 (d) (~b) (iii) 0.000005
w

Ans. (a) a&b = (00000100)2 = (4)10 7. What is the significance of null (\0) character in
(b) a|b = (00011111)2 = (31)10 a string?
(c) a^b = (00011011)2 = (27)10 Ans. Sequence of characters enclosed within double quotes
(d) a>>3 = (00000001)2 = (1)10 are called as String literals. By default, string literals
are automatically added with a special character ‘\0’
(e) (~b) = (00001011)2 = (11)10
(Null) at the end.

orders@surabooks.com PH: 9600175757 / 8124201000 / 8124301000


This is only for Sample Materials
for Full Book order online and available at all Leading Bookstores
136 Sura’s  XI Std - Computer Science ➠ Volume II ➠ Unit III ➠ Chapter 9
Therefore, the string “welcome” will actually be a 10 p 3 2 q
represented as “welcome\0” in memory and the size
of this string is not 7 but 8 characters i.e., inclusive ×
(ii) +
(a +10) < p - (3 + 2q)
of the last character \0. -
+

8. What is the use of operators? <

m
Ans. Operators are used to perform calculations on an
operands that yield a new value. 17. Write an expression involving a logical operator
to test, if marks are 75 and grade is 'A'.
9. What are binary operators? Give examples of
Ans. If (marks > = 75)

co
arithmetic binary operators.
cant << "grade is 'A' ;
Ans. Binary operators are the operators that required two
operands.
Eg : x = a + b - c. Hands on Practice

s.
10. What does the modulus operator % do? Type the following C++ programs in Dev C++
Ans. Modulus operator (%) is used to get the remainder of IDE and execute. If compiler shows any errors,
two integer division. try to rectify it and execute again and again till

ok
Eg : 10% 3 = 1 you get the expected result.
11. What will be the result of 8.5 % 2? 1. C++ Program to find the total marks of three
Ans. 0.5(Reminder is the answer). subjects.
12. Assume that R starts with value 35. What will #include <iostream>
o
be the value of S from the following expression? using namespace std;
S=(R--)+(++R). int main()
ab
Ans. S = 70. {
13. What will be the value of j = - - k + 2k. if k is 20 int m1, m2, m3, sum;
initially ? cout << "\n Enter Mark 1: ";
Ans. j = 59. cin >> m1;
ur

14. What will be the value of p = p * ++j where j is 22 cout << "\n Enter Mark 2: ";
and p = 3 initially? cin >> m2;
Ans. 69. cout << "\n Enter Mark 3: ";
cin >> m3;
.s

15. Give that i = 8, j = 10, k = 8, What will be result of


the following expressions? sum = m1 + m2 + m3;
(i) i < k (ii) i < j (iii) i > = k (iv) i = = j (v) j ! = k cout << "\n The sum = " << sum;
}
w

Ans. (i) False (ii) True


• Make changes in the above code to get the
(iii) True (iv) False
average of all the given marks.
(v) True
w

Ans. #include <iostream>


16. What will be the order of evaluation for the using namespace std;
following expressions?
int main()
(i) i + 3 >= j – 9 (ii) a +10 < p – 3 + 2 q {
w

i 3 j 9 int m1, m2, m3, avg;


cout << "\n Enter the mark 1n ";
Ans. (i) + - (i + 3) > = (j – 9)
cin >> m1>>m2>>m3;
>=
avg = (m1+m2+m3)/3;
cout << "The average = "<<avg;

orders@surabooks.com PH: 9600175757 / 8124201000 / 8124301000


This is only for Sample Materials
for Full Book order online and available at all Leading Bookstores
Sura’s  XI Std - Computer Science ➠ Introduction to C++ 137

2. C++ program to find the area of a circle. 2. int num1, num2; (variable declaration statement
#include <iostream> missing)
using namespace std; 3. cin >> num1 >> num2; (instead of extraction
int main() operator, insertion operator in the statement)
{
4. sum = num1 + num 2; (always the expression

m
int radius;
come in RHS)
float area;
5. cout << "\n The sum = " << sum; (insertion
cout << "\n Enter Radius: ";
cin >> radius; operator is required)

co
area = 3.14 * radius * radius; 6. }  (to End the program using curly braces)
cout << "\n The area of circle = " << area; Corrected program :
} #include<iostream.h>
Ans. #include <iostream> int main ()

s.
using namespace std; {
int main()
cout << "Enter a value";
{

ok
cin >> num1 >> num2'
float r, area;
sum = num1 + num2;
cout << "\n Enter Radius: ";
cin >> r; cout << "\n The sum = "<< sum;
area = 3.14 * r * r; }
o
cout << "\n The Area of the circle is " << area; 4. Point out the type of error in the following
}
program
ab
Output:
#include <iostream>
Enter Radius: 6.5
The Area of the circle is 132.665 using namespace std;
int main()
3. Point out the errors in the following program:
ur

Using namespace std; {


int main( ) int h=10; w=12;
{ cout << "Area of rectangle" << h+w;
cout << “Enter a value ”;
.s

}
cin << num1 >> num2
Ans. int h = 10, w = 12;
num+num2=sum;
cout<< "Area of rectangle"<<h + w;
cout >> “\n The Sum= ” >> sum;
w

Ans. 1. #include<iostream.h>(pre-processor statement


missing)
w
w

orders@surabooks.com PH: 9600175757 / 8124201000 / 8124301000


This is only for Sample Materials
for Full Book order online and available at all Leading Bookstores
138 Sura’s  XI Std - Computer Science ➠ Volume II ➠ Unit III ➠ Chapter 9

Data Types, Variables and Expressions


Evaluation
Part - I 10. This can be used as alternate to endl command:

m
(a) \ t (b) \ b
Choose the Correct Answer: (c) \ 0 (d) \ n [Ans. (d) \ n]
1. How many categories of data types are available

co
in C++? Part - II
(a) 5 (b) 4 (c) 3 (d) 2 Answer to All the questions : (2 Marks)
 [Ans. (c) 3]
2. Which of the following data types is not a 1. Write a short note const keyword with an example.
fundamental type?

s.
Ans. Const is the keyword used to declare a constant. It
(a) signed (b) int modifies/restricts the accessibilty of a variable
(c) float (d) char[Ans. (a) signed] Eg: const int n = 200;
What will be the result of following statement?

ok
3.
2. What is the use of setw() format manipulator?
char ch= 'B';
Ans. Setw()manipulator sets the width of the field
cout << (int) ch; assigned for the output. The field width determines
(a) B (b) b (c) 65 (d) 66 the minimum number of characters to be written in
 [Ans. (d) 66] output. Syntax : setw(number of characters)
4.
o
Which of the character is used as suffix to indicate
3. Why is char often treated as integer data type?
a floatig point value?
ab
Ans. Character data type is often said to be an integer type,
(a) F (b) C (c) L (d) D
since all the characters are represented in memory by
 [Ans. (a) F]
their associated ASCII Codes. If a variable is declared
5. How many bytes of memory is allocated for the as char, C++ allows storing either a character or an
following variable declaration if you are using integer value.
ur

Dev C++? short int x;


(a) 2 (b) 4 (c) 6 (d) 8 4. What is a reference variable? What is its use?
Ans. Reference is an alternative name for a variable. A
 [Ans. (a) 2]
reference provides an alias for a previously defined
6. What is the output of the following snippet? variable. Declaration of a reference consists of
.s

char ch = 'A'; ch = ch + 1; base type and an & (ampersand) symbol; reference


(a) B (b) A1 (c) F (d) 1 A variable name is assigned the value of a previously
declared variable.
 [Ans. (a) B]
w

7. Which of the following is not a data type modifier? 5. Consider the following C++ statement. Are they
equivalent?
(a) signed (b) int
char ch = 67; char ch = 'C';
(c) long (d) short [Ans. (b) int]
w

Ans. yes, they are equal.


8. Which of the following operator returns the size
of the data type? Alphabets Decimal
(a) sizeof( ) (b) int () Number
w

(c) long () (d) double () A 65


 [Ans. (a) sizeof( )] B 66
9. Which operator is used to access reference of C 67
variable? D 68
(a) $ (b) # (c) & (d) ! E 69
 [Ans. (c) &] F 70

orders@surabooks.com PH: 9600175757 / 8124201000 / 8124301000


This is only for Sample Materials
for Full Book order online and available at all Leading Bookstores
Sura’s  XI Std - Computer Science ➠ Introduction to C++ 139

6. What is the difference between 56L and 56? 2. Evaluate x+=x + ++x; Let x=5
Ans. 56 is an integer number. Ans. x + = x + + + x
56L is a long integer number. x = x + x+++ x;
= 5 + 5 + 6 = 16.
7. Determine which of the following are valid
constant? And specify their type. 3. How relational operators and logical operators

m
(i) 0.5 (ii) 'Name' (iii) '\t' (iv) 27,822 related to one another?
Ans. (i) 0.5 - Valid Floating Constant Ans. Logical operators uses AND (&&), OR (¦ ¦)
(ii) 'Name' - Invalid String Constant (Enclosed and NOT(!). These operators yield true or false
depending upon the out come of different relational

co
within Double quotes)
expressions. Relational expressions are formed by
(iii) '\t' - Valid - Non graphic character data type Relational operators.
(iv) 27,822 - Invalid Decimal Constant (Commas 4. Evaluate the following C++ expressions where x, y,
is not allowed). z are integers and m,n are floating point numbers.

s.
8. Suppose x and y are two double type variable that The value of x = 5, y = 4 and m = 2.5;
you want add as integer and assign to an integer (i) n = x + y / x;
variable. Construct a C++ statement to do the above. (ii) z = m * x + y;

ok
Ans. double x; (iii) z = (x ++) * m + x;
double y; Ans. (i) n = x + y / x;
int z = (int) x + (int) y; or int z = (int)(x + y);
n=5+(4/5)
9. What will be the result of following if num=6 n = 5 + 0.8
initially
o n = 5.8
(a) cout << num; (ii) z = m * x + y;
ab
(b) cout << (num ==5);
z = ( 2.5 * 5) + 4
Ans. (a) 6
z =12.5 + 4
(b) 0 z = 16.5
10. Which of the following two statements are valid? z = 16 (z is an integer)
ur

Why? Also write their result int a; (iii) z = ( x++) * m + x;


(i) a = 3,014; (ii) a=(3,014); z = ((5++) * 2.5) + 5
Ans. (i) Above the two statements is Invalid. z = (5 * 2.5) + 5
.s

(ii) Special Symbols are not allowed in the integer z = 12.5 + 5


values ( Commas, Open and Close Brackets).
z = 17.5
Part - III z =17 (z is an integer).
w

Answer to All the questions : (3 Marks)


Evaluate Yourself
1. What are arithmetic operators in C++?
Differentiate unary and binary arithmetic
w

operators. Give example for each of them 1. What do you mean by fundamental data types?
Ans. (i) The operators, which are applied to perform Ans. (i) Fundamental data types are predefined data
arithmetical calculations in a program are types available in C++.
w

known as arithmetical operators. (ii) These are five fundamental data types in C++.
(ii) A unary operator requires a single (one) operand. 2. The data type char is used to represent characters.
Unary +, Unary -, ++, -- are the examples of then why is it often termed as an integer type?
many operators.
Ans. Since all the characters are represented in memory
(iii) A binary operator requires two operands +, -, *,
/, % are the examples of binary operators. by their associated ASCII codes.

orders@surabooks.com PH: 9600175757 / 8124201000 / 8124301000


This is only for Sample Materials
for Full Book order online and available at all Leading Bookstores
140 Sura’s  XI Std - Computer Science ➠ Volume II ➠ Unit III ➠ Chapter 9
3. What is the advantage of floating point numbers 12. How implicit conversion different from explicit
over integers? conversion?
Ans. (i) Floating point number can represent values Ans. (i) Implicit type conversion is automatically done
between the integers. by compiler.
(ii) Floating point number can represent a much (ii) Explicit type conversion is done by the
greater range of values.

m
programmer.
4. The data type double is another floating point
type. Why is it treated as a distinct data type? 13. What is difference between endl and \n?
Ans. In double data type, more fractions can be Ans. endl – Inserts a new line and flushes the buffer (Flush

co
accommodated in double than in float data type. means – clean) ‘\n’ - Inserts only a new line.
5. What is the use of void data type?
14. What is the use of references?
Ans. Void data type is used as a return type for functions
Ans. References means addresses. Address are used to
that do not return any value.

s.
6. What is modifiers? What is the use of modifiers? locate the value in the memory.
Ans. (i) Modifiers can be used to modify (expand 15. What is the use of setprecision ( ) ?
or reduce) the memory allocation of any Ans. It is used to display numbers with fractions in specific

ok
fundamental data type. number of digits.
(ii) Modifier is a qualifiers used along with data Hands on Practice
type.
7. What is wrong with the following C++ statement:
o 1. Write C++ programs to interchange the values of
long float x; two variables.
Ans. Instead of long float x use double x; a. Using with third variable
ab
8. What is a variable ? Why a variable called b. Without using third variable
symbolic variable? Ans. a. Using with third variable
Ans. (i) Variables are user-defined names assigned to #include<iostream.h>
specific memory locations in which the values using namespace.std;
ur

are stored. int main ()


(ii) These are called as symbolic variables because {
these are named locations. int a, b, t;
9. What do you mean by dynamic initialization of a cout<<"\n Enter First number";
.s

variable? Give an example. cin>>a;


cout<<"\n Enter Second number";
Ans. (i) A variable can be initialized during the
cin>>b;
w

execution of a program. It is known as 'Dynamic


t=a;
initialization.'
a=b;
(ii) For example : int n1, n2,s; s = n1+n2. This two
b=t;
w

statements combined into a single statement cout<<a<<'\t'<<b;


using dynamic initialization int s = n1+n2; return 0;
10. What is wrong with the following statement? }
w

const int x; b. Without using third variable :


Ans. No value specified to the variable x correct statement; #include<iostream.h>
const int x = 100; using namespace.std;
11. What is meant by type conversion? int main ()
{
Ans. The process of converting one fundamental type into
int a, b;
another is called as "Type conversion".
cout<<"\n Enter First number";

orders@surabooks.com PH: 9600175757 / 8124201000 / 8124301000


This is only for Sample Materials
for Full Book order online and available at all Leading Bookstores
Sura’s  XI Std - Computer Science ➠ Introduction to C++ 141

cin>>a; {
cout<<"\n Enter Second number"; float tempC, tempF;
cin>>b; cout<<"\n Enter celcius";
a = a+b; cin>>tempC;
b = a-b; tempF =(tempC * 1.8F)+32;
a = a-b;  cout<<"Equivalent temperature of

m
cout<<a<<'\t'<<b; <<tempC <<"in Fahrenheit is"<<
return 0; tempF<<endl;
} return 0;

co
2. Write C++ programs to do the following: }
a. To find the perimeter and area of a quadrant 3. Write a C++ to find the total and percentage of
b. To find the area of triangle marks you secured from 10th Standard Public
c. To convert the temperature from Celsius to Exam. Display all the marks one-by-one along
Fahrenheit with total and percentage. Apply formatting

s.
Ans. a. To find the perimeter and area of a quadrant
functions.
Ans. #include<iostream.h>
#include<iostream.h>
using namespace.std; #include<iomanip.h>

ok
int main () using namespace std;
{ int main ()
float area, peri, r; {
cout<<"\n Enter radius"; char name[30];
cin>>r;
o
area=0.25*3.14*r*r;//Area=1/4πr2
float E,L,M,S,SS,tot, per;
peri=0.5*3.14*r;//perimeter = 1/2πr cout<<"\n Name = ";
ab
 cout <<"Area of a quadrant = "<< cin>> name;
area<endl; cout <<"\ Enter English, Language, Maths,
cout<<"Perimeter of a quadant = " << peri  Science, Social Marks";
<<endl; cin >> E >> L >> M >> S >> SS;
return 0;
ur

tot = E+L+M+S+SS;
}
b. To find the area of triangle : per = tot/500*100;
#include<iostream.h> cout<<setw(20)<<"Name:"<<setw(10)<<
using namespace.std; name;
.s

int main () cout <<setw (20) <<"English:" <<setw(10)<<


{
E<<endl;
float area, b, h;
cout <<setw (20) << "Tamil:"<<setw(10)<<
w

cout<<"\n Enter base";


cin>>b; T<<endl;
cout<<"\n Enter height"; cout <<setw (20)<<"Maths:"<<setw(10)<<
cin>>h;
w

M<<endl;
area = 0.5*b*h //Area=1/2bh
cout<<setw(20)<<"Science:"<<setw(10)<<S <<endl;
 cout <<"Area of a triangle = "<<
area<endl; cout<<setw(20)<<"SocialScience:"<< setw(10)
w

return 0;  << SS<<endl;


} cout <<setw (20) <<"Total:" << setw(10) << tot<<endl;
c. To convert the temperature from Celsius to cout << setw (20) << "Percentage:" << setw(10)
Fahrenheit  << per<<endl;
#include<iostream.h> return 0;
using namespace.std; }
int main ()

orders@surabooks.com PH: 9600175757 / 8124201000 / 8124301000


This is only for Sample Materials
for Full Book order online and available at all Leading Bookstores
142 Sura’s  XI Std - Computer Science ➠ Volume II ➠ Unit III ➠ Chapter 9

additional questions and Answers


9. Which of the following are the reserved words in
Choose the Correct Answers 1 MARK c++?
(a) Keywords (b) Punctuators
I. Choose the Correct

m
options for the
(c) Operators (d) Constants
below Questions.
 [Ans. (a) Keywords]
1. Which of the following is an object oriented 10. Which of the following is not a Keyword in c++?

co
programming?
(a) asm (b) const
(a) C++ (b) C
(c) constant (d) using
(c) Html (d) Windows XP
 [Ans. (c) constant]
 [Ans. (a) C++]
11. Which of the following statement is not true?

s.
2. Which of the following supports both procedural
(a) C++ is highly portable language  [HF. 2018]
and oop concepts?
(b) The language of choice for Multi-device, Multi-
(a) C (b) Java
Platform app developed

ok
(c) C++ (d) Basic[Ans. (c) C++]
(c) C++ has not a function library
3. Which of the following is not a newer versions of (d) C++ is on Object Oriented Programming
languages influenced by c++? Language
(a) C# (b) D.  [Ans. (c) C++ has not a function library]
(c) Java
o
(d) Html[Ans. (d) Html] 12. Which of the following is an invalid variable
4. Which of the following application not developed name?
ab
by c++? (a) This (b) num
(a) Android (b) IOS7 (c) Num (d) -sum [Ans. (a) This]
(c) Facebook (d) Amazon 13. How many ways the numeric constants are
 [Ans. (b) IOS7] classified?
ur

5. Which of the following are possible in c++? (a) 2 (b) 3 (c) 4 (d) 6
(a) Polymorphism (b) Encapsulation  [Ans. (a) 2]

(c) Inheritance (d) All of these 14. How many type of Integer constants are there?
.s

 [Ans. (d) All of these] (a) 2 (b) 3 (c) 6 (d) 4


 [Ans. (b) 3]
6. How many ASCII characters can processed by c++?
15. 75.46 is assigned as an integer constant. What will
w

(a) 512 (b) 256


be value taken by the c++ compiler?
(c) 128 (d) 64 [Ans. (b) 256]
(a) 75 (b) 75.4 (c) 46 (d) 75.46
7. The smallest individual unit in a program is  [Ans. (a) 75]
w

known as?
16. Which of the following is a valid octal constant?
(a) Tokens (b) lexical units
(c) lexical elements (d) a or b or c (a) 0127 (b) 0128 (c) 0911 (d) 0181
w

 [Ans. (d) a or b or c]  [Ans. (a) 0127]


8. Which of the following is not a c++ token? 17. Which of the following is not a valid octal
(a) Keywords (b) Punctuators constant?
(c) expression (d) Seperators (a) 012 (b) 0158 (c) -0127 (d) 0732
 [Ans. (c) expression]
 [Ans. (b) 0158]

orders@surabooks.com PH: 9600175757 / 8124201000 / 8124301000


This is only for Sample Materials
for Full Book order online and available at all Leading Bookstores
Sura’s  XI Std - Computer Science ➠ Introduction to C++ 143

18. A constant starts with Ox or OX is called? 27. Which is not a logical operator?
(a) Octal constant (a) && (b) !! (c) ! (d) &
(b) Integer Constant  [Ans. (d) &]
(c) Real Constant
28. Which is not an logical operator?
(d) Hexadecimal Constant
(a) ++ (b) -- (c) ! (d) &&

m
 [Ans. (d) Hexadecimal Constant]
 [Ans. (d) &&]
19. In How many forms the real constant can be
29. Which operator is not a logical bitwise operators?
written?

co
(a) & (b) ¦ (c) ^ (d) !
(a) 2 (b) 3 (c) 4 (d) 6 
 [Ans. (d) !]
 [Ans. (a) 2]
30. Which operator denotes shift left bitwise?
20. How many parts are there in exponent form of
real constant? (a) >> (b) >>> (c) << (d) <<<

s.
(a) 1 (b) 2 (c) 3 (d) 4  [Ans. (c) <<]
 [Ans. (b) 2] 31. Which operator denotes shift right bitwise?
(a) >> (b) << (c) & (d) !

ok
21. Which of the following is invalid character  [Ans. (a) >>]
constants? 32. Which of the following is not a shorthand
(a) 'A' (b) '5' (c) "A" (d) '\a' assignment operator?
 [Ans. (c) "A"]
o
22. Which of the following character automatically
(a) + = (b) * =
(c) ! = (d) % = [Ans. (c) ! =]
added at the end of string literal?
ab
33. Which of the following operator used as an
(a) \n (b) \o (c) \a (d) "
alternate if - else control statement?
 [Ans. (b) \o]
(a) Unary (b) binary
23. Which operator is used to find the reminder of a (c) Ternary (d) Relational
ur

divisions?
 [Ans. (c) Ternary]
(a) / (b) % (c) * (d) ^
 [Ans. (b) %] 34. Which operator will return true if only one of the
operand is true?
.s

24. 10 % 5 =? (a) & (b) ¦ (c) ^ (d) ¦ ¦


(a) 2 (b) 0 (c) 10 (d) 5  [Ans. (c) ^]
 [Ans. (b) 0]
35. Which is used to label a c++ statement?
w

25. Which of the following are unary operators? (a) , (b) ; (c) : (d) : :
(a) ++, -- (b) &&, ¦ ¦ (c) &, ¦ ¦ (d) ^, &&  [Ans. (c) :]
 [Ans. (a) ++,--]
w

36. Which of the following header file included to


26. Which of the following operators are evaluated by implement I/o functionalities?
a logical operator? (a) istream (b) iostream
w

(a) logical, relational (c) ostream (d) conio


(b) unary, binary  [Ans. (b) iostream]
(c) Arithmetic, Assignment
37. Which language is an extension of c language?
(d) Bitwise, binary [Ans. (a) logical, relational]
(a) C++ (b) Java
(c) oop (d) python[Ans. (a) C++]

orders@surabooks.com PH: 9600175757 / 8124201000 / 8124301000


This is only for Sample Materials
for Full Book order online and available at all Leading Bookstores
144 Sura’s  XI Std - Computer Science ➠ Volume II ➠ Unit III ➠ Chapter 9
38. Which of the following operator is used toget 47. Which operator is called as compile time operator?
input in c++? (a) comma (b) bitwise
(a) << (b) >> (c) ! = (d) = = (c) Relational (d) size of
 [Ans. (a) <<]  [Ans. (d) size of]
48. Which operator returns the length of a variable
39. Which oop's principle hides data?
in bytes?

m
(a) Inheritance (b) Encapsulation (a) compile time (b) comma
(c) Polymorphism (d) none of these (c) pointer (d) none of these
 [Ans. (b) Encapsulation]  [Ans. (a) compile time]

co
40. Which of the following feature avoid name 49. Which C++ is written in Delphi?
collection in C++?
(a) Eclipse (b) Net Beans
(a) Data hiding (b) Data abstraction
(c) Visual C++ (d) Dev C++
(c) Object oriented (d) namespace
 [Ans. (d) Dev C++]

s.
 [Ans. (d) namespace]
50. Which of the following data type created by the
41. Which of the following possible in C++?
programmer?
(a) Exceptin Handling (b) Over loading

ok
(a) User defined (b) Fundamental
(c) Data hiding (d) all of these (c) built-in (d) derived
 [Ans. (d) all of these]  [Ans. (a) User defined]
42. Which of the following is not a white space 51. Which of the following is not a datatype in C++?
character in C++? (a) Void (b) int
(a) Balckspace (b) ASCII
o (c) for (d) double [Ans. (c) for]
(c) formfeed (d) Carriage return
ab
52. What is the value stored in C if int c=15.06?
 [Ans. (b) ASCII]
(a) 15 (b) 06
43. Which is an identifier example of capital style (c) 1506 (d) 15.06 [Ans. (a) 15]
notation?
53. Which of the following characters accepted by
(a) NUM_ADD (b) NUM_add
ur

char datatype?
(c) NUMADD (d) num_Add
(a) BCD (b) ASCII
 [Ans. (d) num_Add]
(c) ISCII (d) EBCDIC
44. Which letter exist between Mantissa and Exponent  [Ans. (b) ASCII]
.s

part of a real constant?


54. Which of the following datatype specifies an
(a) L or l (b) U or u empty set of values?
(c) E or e (d) X or x (a) int (b) float
w

 [Ans. (c) E or e] (c) double (d) void [Ans. (d) void]

45. Which error is also called logic error? 55. How many hits occupied by long double datatype
w

in Dev C++?
(a) Syntax (b) Semantic
(a) 32 bits (b) 64 bits
(c) Runtime errors (d) all of these
(c) 80 bits (d) 120 bits
 [Ans. (b) Semantic]  [Ans. (c) 80 bits]
w

46. Which of the following operator bit-by-bit 56. Which of the following keyword restricts the
operation? accessibility of a variable?
(a) Bitwise operator (b) Relational operator (a) access (b) Specifier
(c) Logical operator (d) all of these (c) Modify (d) Const
 [Ans. (a) Bitwise operator]  [Ans. (d) Const]

orders@surabooks.com PH: 9600175757 / 8124201000 / 8124301000


This is only for Sample Materials
for Full Book order online and available at all Leading Bookstores
Sura’s  XI Std - Computer Science ➠ Introduction to C++ 145

57. What is an alternative name for a variable? 66. Which of the following is also called automatic
(a) Specifier (b) Modifier conversion?
(c) Reference (d) none of these (a) Explicit (b) Type promotion
 [Ans. (c) Reference] (c) Type casting (d) Implicit
 [Ans. (d) Implicit]
58. Which of the following Manipulator belongs to

m
iostream.h? 67. Which of the following is data types is C++?
(a) Setw (b) Setfill (a) long (b) unsigned
(c) Setf (d) endl [Ans. (d) endl] (c) signed (d) void [Ans. (d) void]

co
59. Which of the following Manipulator determines 68. Which of the following is not a derived datatype?
the minimum number of characters to be written (a) Array (b) void
in C++ output? (c) function (d) pointer[Ans. (b) void]
(a) Setf (b) Setfill

s.
(c) Setprecission (d) Setw II. Match List I with List II and Select
 [Ans. (d) Setw] the Correct Answer using the Codes given
below.
60. Which of the following Manipulator is used for

ok
filling the empty fields?
(a) Setf (b) Setfill 1.
List I List II
(c) Setw (d) all of these (i) New line 1 Numeric
 [Ans. (b) Setfill] (ii) #,{,< 2 Alphabets
o (iii) 59 3 Special characters
61. Which of the following is an invalid real constant?
ab
(iv) Number 4 White space
(a) –13.5 (b) 17/2
(c) 2.0 (d) 0.5E01[Ans. (b) 17/2] Codes:
62. How many operators formed from ASCII (i) (ii) (iii) (iv)
characters in C++? (a) 4 1 3 2
ur

(a) 27 (b) 57 (b) 1 3 2 4


(c) 37 (d) 17 [Ans. (c) 37] (c) 4 3 2 1
(d) 3 4 1 2
63. The float datatype uses the precision of decimal  [Ans. (c) (i)-4, (ii)-3, (iii)-2, (iv)-1]
.s

digits is?
(a) 8 (b) 6 2.
List I List II
(c) 32 (d) 7 [Ans. (d) 7] (i) –027 1 fixed point constant
w

64. Which of the following can be stored in the (ii) –27 2 Hexadecimal
character variable? constant
(a) character (b) integer
w

(iii) 0x123 3 floating point


(c) either a or b (d) strong constant
 [Ans. (c) either a or b]
(iv) IEO 4 Octal constant
65. Which of the following datatypes used to produce
w

more accurate results? Codes:


(a) int (b) float (i) (ii) (iii) (iv)
(c) void (d) long int (a) 4 1 2 3
 [Ans. (b) float] (b) 1 3 2 4
(c) 4 3 2 1
(d) 3 4 1 2
 [Ans. (a) (i)-4, (ii)-1, (iii)-2, (iv)-3]

orders@surabooks.com PH: 9600175757 / 8124201000 / 8124301000


This is only for Sample Materials
for Full Book order online and available at all Leading Bookstores
146 Sura’s  XI Std - Computer Science ➠ Volume II ➠ Unit III ➠ Chapter 9
3. List I List II List I List II
(i) 0125 1 character constant (i) \v 1 Vertical tab
(ii) 0.58E3 2 string constant (ii) \\ 2 Back slash
(iii) '8' 3 fixed point constant (iii) \’or\” 3 Single / double
quotes

m
(iv) "5000" 4 floating point constnat
Codes: (iv) \o 4 Octal number
(i) (ii) (iii) (iv) Codes:

co
(a) 3 4 1 2 (i) (ii) (iii) (iv)
(b) 1 3 2 4 (a) 3 2 1 4
(c) 4 3 1 2 (b) 2 3 4 1
(d) 4 1 2 3 (c) 2 1 4 3
 [Ans. (a) (i)-3, (ii)-4, (iii)-1, (iv)-2] (d) 1 2 3 4

s.
4.  [Ans. (d) (i)-1, (ii)-2, (iii)-3, (iv)-4]
List I List II
(i) → 1 Pointer
III. Choose the Correct Option Fill

ok
and in
(ii) :: 2 Conditional
the Blanks.
operator
(iii) &(Address of) 3 Classmember 1. In C++, the ++ denotes
operator (a) plus (b) plus plus
(iv) ?: 4
o
Component (c) addition (d) increment
selection  [Ans. (d) increment]
ab
Codes: 2. C++ is standardized by the
(i) (ii) (iii) (iv) (a) OSI (b) ISO
(a) 3 4 1 2 (c) AT & T (d) ANSI[Ans. (b) ISO]
(b) 1 3 2 4
ur

3. The latest standard version of C++ which is


(c) 4 3 1 2 informally known as
(d) 4 1 2 3 (a) C++11 (b) C++14
 [Ans. (c) (i)-4, (ii)-3, (iii)-1, (iv)-2] (c) C++17 (d) C++03
.s

5.  [Ans. (c) C++17]


List I List II
(i) int, char 1 derived data type 4. Identifiers are also called
(a) literals (b) constants
w

(ii) class 2 Built in data type


(c) variables (d) seperators
(iii) Pointer 3 User defined data type  [Ans. (c) variables]
5. Literals are also called
(iv) void 4 fundamental data type
w

(a) constants (b) punctuators


Codes: (c) operators (d) identifiers
(i) (ii) (iii) (iv)  [Ans. (a) constants]
w

(a) 3 4 1 2 6. Fixed point constant are also called


(b) 1 3 2 4 (a) Strong constant
(c) 4 3 1 2
(b) Character constant
(d) 4 1 2 3
 [Ans. (c) (i)-4, (ii)-3, (iii)-1, (iv)-2] (c) Integer constant
(d) Floating point constant
 [Ans. (b) Character constant]

orders@surabooks.com PH: 9600175757 / 8124201000 / 8124301000


This is only for Sample Materials
for Full Book order online and available at all Leading Bookstores
Sura’s  XI Std - Computer Science ➠ Introduction to C++ 147

7. Real constants are also called 17. '\n' escape sequence represents
(a) Fixed point constant (a) NULL (b) form feed
(b) Floating point constant (c) tab (d) new line
(c) Integer constant  [Ans. (d) new line]
(d) Strong constant 18. An escape sequence character enclosed with in

m
 [Ans. (b) Floating point constant] (a) " " (b) < > (c) { } (d) ' '
8. Signed Integers are considered as  [Ans. (d) ' ']

co
(a) positive number (b) real number 19. String literals always enclosed with
(c) octal number (d) negative number (a) " " (b) ' '
 [Ans. (d) negative number] (c) < > (d) none of these
 [Ans. (a) " "]

s.
9. An escape sequence is represented by a
20. The length of the string "School" is
(a) / (b) " " (c) ' ' (d) \
 [Ans. (d) \] (a) 6 (b) 7 (c) 8 (d) none
 [Ans. (b) 7]

ok
10. A Hexadecimal Constant is always
(a) Negative Number (b) Real Number 21. In the expression x * y, where x and y denotes
(c) Positive Number (d) Integer (a) operators (b) punctuators
 [Ans. (c) Positive Number]
o (c) operands (d) constants
11. In the given exponent form of real constant 0.78E6  [Ans. (c) operands]
Where E6 is a_____part
ab
(a) Real (b) Integer 22. Name the type of operator in which % operator
(c) Mantissa (d) Exponent belongs
 [Ans. (d) Exponent] (a) Arithmetic (b) Relational
12. In the given exponent form of real constant 0.87E5 (c) Ternary (d) logical
ur

Where 0.87 is a_____part  [Ans. (a) Arithmetic]


(a) Mantissa (b) Real
23. x = ++a + ++b; what is the value of x if a =5, b=5;
(c) Exponent (d) Integer
(a) 10 (b) 11 (c) 12 (d) 22
 [Ans. (a) Mantissa]
.s

 [Ans. (c) 12]


13. Boolean literal true has value 24. y = ++a + a++; what is the value of y if a = 6;
(a) 0 (b) 1 (c) 0.5 (d) 0.2
(a) 14 (b) 13 (c) 12 (d) 0
w

 [Ans. (b) 1]

14. A character constant enclosed with in  [Ans. (c) 14]
(a) " " (b) { } (c) < > (d) ' '
w

25. When the relational operators are applied to three


 [Ans. (d) ' '] operands, the result will be a
15. The ASCII value of A is (a) Real value (b) Exponent value
w

(a) 65 (b) 75 (c) 85 (d) 97 (c) Numerical value (d) Boolean value
 [Ans. (a) 65]
 [Ans. (d) Boolean value]

16. An escape sequence '\O' represents 26. The relation operator symbol represents "Equal
to" is
(a) Octal number (b) NULL
(a) a = = (b) = (c) ! = (d) = = =
(c) Vertical tab (d) alert bell
 [Ans. (b) NULL]  [Ans. (a) a = =]

orders@surabooks.com PH: 9600175757 / 8124201000 / 8124301000


This is only for Sample Materials
for Full Book order online and available at all Leading Bookstores
148 Sura’s  XI Std - Computer Science ➠ Volume II ➠ Unit III ➠ Chapter 9
27. All six relational operators are 38. The expansion of IDE is
(a) unary operators (b) binary operators (a) Important Development Environment
(c) Ternary operators (d) Arithmetic operators (b) Integrated Development Environment
 [Ans. (b) binary operators]
(c) Integrated Digital Environment
28. Which symbol denotes Bitwise Exclusive Or (d) Integrated Digital Extension

m
(Binary XoR)  [Ans. (b) Integrated Development Environment]
(a) & (b) ^ (c) ¦ (d) !
39. Name the software that converts source code to
 [Ans. (b) ^]
object code

co
29. If a = 4, b = 5, the value a & b is (a) Application (b) IDE
(a) 910 (b) 510 (c) 010 (d) 410 (c) Linker (d) Compiler
 [Ans. (d) 410]  [Ans. (d) Compiler]
40. The c++ statement begin with____are treated as

s.
30. If a = 4, b = 5, the value a ^ b is comments.
(a) 010 (b) 110 (c) 910 (d) 110 (a) \\ (b) // (c) */ (d) ##
 [Ans. (b) 110]  [Ans. (b) //]

ok
31. The conditional operators are 41. The expansion of ASCII is
(a) American Standard code for Information
(a) ++, – – (b) ? : (c) ! = (d) = =
Interchange
 [Ans. (b) ? :]
o (b) ANSI Standard code for Information Interchange
32. The logical grouping of an operators are called (c) American Standard code for Interchange
(a) Precedence (b) order Information
(c) association (d) execution (d) American Standard code for Intel Information.
ab
 [Ans. (c) association] [Ans. (a) American Standard code for Information
Interchange]
33. Punctuators are also called as
42. Non-printable characters are called
(a) operators (b) seperators
(a) Character (b) String constant
ur

(c) delimiters (d) literals (c) non-graphical character


 [Ans. (b) seperators] (d) Octal constant
 [Ans. (c) non-graphical character]
34. The punctuators used to denote arrays
.s

(a) { } (b) < > (c) ( ) (d) [ ] 43. The logical group of an operators are called
 [Ans. (d) [ ]] (a) order of precedence (b) association
(c) specifiers (d) modifiers
35. The c++ statements are terminated by
w

 [Ans. (b) association]


(a) { } (b) ( ) (c) , (d) ;
 [Ans. (d) ;] 44. More than one executable statements together are
called
w

36. The operator used to perform output operation is (a) conditional statement (b) control statement
(a) << (b) >> (c) compound statement (d) assignment statement
(c) extraction (d) getfrom[Ans. (a) <<]  [Ans. (c) compound statement]
w

37. The symbol used to denote preprocessor directive 45. What is the output for the following
statement is Charch = 'A';
(a) # (b) // (c) @ (d) { Ch=ch+2;
 [Ans. (a) #] Cout << ch;
a. A2 b.2A c. C d.A
 [Ans. (c) C]

orders@surabooks.com PH: 9600175757 / 8124201000 / 8124301000


This is only for Sample Materials
for Full Book order online and available at all Leading Bookstores
Sura’s  XI Std - Computer Science ➠ Introduction to C++ 149

46. Predict the output for the following 55. In a programming language, fields are referred to
Char x = 98; as
Cout << x-1; (a) variables (b) operators
a. A b.97 c. 98 d.a (c) Punctuators (d) constants
 [Ans. (d) a]  [Ans. (a) variables]

m
47. The expansion of UTF is 56. In a programming language, the values are
(a) Uniform Transformation File referred to as
(b) Unicode Transformation Format (a) variables (b) data

co
(c) Unicode Transfer File (c) function (d) none of these
(d) Uniform Transfer Format  [Ans. (b) data]
 [Ans. (b) Unicode Transformation Format] 57. More than one variable declared in the statement
48. The memory address are in the form of____values should be separated using

s.
(a) Decimal (b) Octal (a) ; (b) .(dot)
(c) Hexadecimal (d) Binary (c) , (comma) (d) . #
 [Ans. (c) Hexadecimal]  [Ans. (c) , (comma)]

ok
49. Assigning a first value to a variable is caused
(a) Assignment (b) Initialization
IV. Which one of the Following is Not
(c) declaration (d) Expression Correctly Matched?
 [Ans. (b) Initialization]
1. Which one of the following is not correctly
50. Write the output
o matched?
Const int x =120; (a) >> - Bitwise operator
ab
x = x+1; (b) % - Arithmetic operator
cout << x;
(c) && - Logical operator
a. 120 b.121 c.x d.error message
(d) = - Ralation operator
 [Ans. (d) error message]
[Ans. (d) = - Ralation operator ]
ur


51. Predict the output :
2. Which one of the following is not correctly
int a =13; matched?
cout << Setw (5) << setfill (o) << a ;
(a) [] - Arrays
.s

a. 13 b.13000
c. 00013 d.13.000[Ans. (c) 00013] (b) () - Termination
(c) {} - Block of a code
52. A real literals are also called
w

(d) // - Comments
(a) integer literals (b) Character literal
 [Ans. (b) ( )-Termination]
(c) string literal (d) none of these
 [Ans. (d) none of these]
w

V. Which one of the Following is Correctly


53. In C++, a reference is also called Matched?
(a) keywords (b) seperators
w

(c) pointers (d) statements 1. Which one of the following is correctly matched?
 [Ans. (c) pointers] (a) char - 8 bits
54. Evaluate x = ++y+2y if y = 6
(b) int - 32 bits
(a) 18 (b) 19
(c) 23 (d) 21 [Ans. (d) 21]
(c) float - 8 bytes
(d) double - 2 bytes
 [Ans. (a) char-8 bits]

orders@surabooks.com PH: 9600175757 / 8124201000 / 8124301000


This is only for Sample Materials
for Full Book order online and available at all Leading Bookstores
150 Sura’s  XI Std - Computer Science ➠ Volume II ➠ Unit III ➠ Chapter 9

VI. Consider the Following Statement. VII. Choose the Correct Statement.

1. Assertion (A) :  C++ program statements are 1. Which of the following is a correct statement?
constructed by many different (i) C++ is a Hybrid language
small elements such as commands, (ii) C++ not an object driven language
variables and constants.

m
(iii) C++ supports exception handling
Reason (R) :  These individual elements are (iv) Data hiding possible
collectively called as lexical units (a) only (i) (ii) (b) only (i), (iii)
or lexical elements or tokens. (c) only (i), (iii),(iv) (d) only (iii), (ii)

co
(a) Both (A) and (R) are true and (R) is the correct  [Ans. (c) only (i), (iii),(iv)]
explanation of (A).
2. Which of the following statement is true?
(b) Both (A) and (R) are true and (R) is not the
(i) int datatype stores 56 as well as 56.78
correct explanation of (A).

s.
(ii) float datatype stores 56.78 as well as 56
(c) (A) is true, but (R) is false.
(iii) Char datatype store both character and integer
(d) (A) is false, but (R) is true.
(a) only (i) (b) only (i) and (iii)
[Ans. (a) Both (A) and (R) are true and (R) is the

ok
(c) only (ii) and (iii) (d) only (i), (ii) and (iii)
correct explanation of (A)]
 [Ans. (d) only (i), (ii) and (iii)]
2. Assertion (A) : Keywords are the reserved words
3. (i)  Arithmetic operators perform simple
which convey specific meaning to
arithmetic operations like addition,
the C++ compiler.
o
Reason (R) : Tokens are the user defined names
subtraction, multiplication division etc.
(ii) Relational operators are used to determine
given to different parts of the C++
the relationship between its operands.
ab
program viz
(iii) A logical operator is used to evaluate logical
(a) Both (A) and (R) are true and (R) is the correct
and relational expressions.
explanation of (A).
(a) (i) is correct
(b) Both (A) and (R) are true and (R) is not the
(b) (i) and (ii) are correct
ur

correct explanation of (A).


(c) (A) is true, but (R) is false. (c) (i) and (iii) are correct
(d) (A) is false, but (R) is true. (d) (i), (ii) and (iii) are correct
[Ans. (c) (A) is true, but (R) is false] [Ans. (d) (i), (ii) and (iii) are correct]
.s

3. Assertion (A) :  Literals are data items whose 4. (i)  Punctuators are symbols, which are used
values do not change during the as delimiters, while constructing a C++
program.
w

execution of a program.
Reason (R) :  The symbols which are used to (ii) C++ provides ccoperator to perform output
do some mathematical or logical operation.
(iii) Identifiers are the reversed words that convey
w

operations are called as operators.


(a) Both (A) and (R) are true and (R) is the correct specific meaning to the C++ compiler.
explanation of (A). (a) (i) is correct
w

(b) Both (A) and (R) are true and (R) is not the (b) (i) and (ii) are correct
correct explanation of (A). (c) (i) and (iii) are correct
(c) (A) is true, but (R) is false. (d) (i), (ii) and (iii) are correct
(d) (A) is false, but (R) is true. [Ans. (b) (i) and (ii) are correct]
[Ans. (b) Both (A) and (R) are true and (R) is not
the correct explanation of (A)]

orders@surabooks.com PH: 9600175757 / 8124201000 / 8124301000


This is only for Sample Materials
for Full Book order online and available at all Leading Bookstores
Sura’s  XI Std - Computer Science ➠ Introduction to C++ 151

5. (i) A computer is a tool to solve a wide range of VIII. Point out the Wrong Statement in
problems. the following.
(ii) The solutions to the problems are in the
form of computer programs or application 1. Which of the following statement is false?
software. (i) float data type takes more time to execute

m
(iii) These programs are written using a chosen (ii) Double data type occupies more space
machine language. (iii) float data type executes faster than double data
(iv) A computer program operates on a set of type
known input data items. (iv) Double data type is also used to handle float data

co
(a) (iii) is correct type
(a) only (i) (b) only (ii)
(b) (i) and (iv) are correct
(c) only (iii) (d) only (iv)
(c) (i) and (iii) are correct
 [Ans. (c) only (iii)]
(d) (i), (ii) and (iii) are correct

s.
(a) C++ was developed at AT & T Bell laboratories
[Ans. (a) (iii) is correct] in the early 1980s by Bjarne Stroustrup.
6. (i) Programming languages have another (b) C++ also comprises a character set from which
the tokens

ok
useuageas vernacular lang.
(ii) They help us in organizing our ideas about (c) The basic types are collectively called as
TOKENS.
the solution of the problem.
(d) A token is the smallest individual unit in a
(iii) The problems being solved or the applications
oroeram. [Ans. (a) C++ was developed
o
being developed became Complex, this aspect
of programming languages became very
at AT & T Bell laboratories in the early 1980s
 by Bjarne Stroustrup.]
important.
ab
(iv) Many programming languages emerged 2. (a) Identifi ers are also called as variables.
to address this issue along with the ease of (b) Variables are memory boxes that hold values or
instructing the computer. constants.
(a) (i) is correct (c) A variable name must begin with an alphabet or
ur

underscore followed by alphabets or numbers.


(b) (i) and (iv) are correct
(d) example_test; test; sum 12 are some valid
(c) (i) and (iii) are correct
identifiers. [Ans. (d) example_test; test; sum
(d) (i), (ii) and (iv) are correct  12 are some valid identifiers]
.s

[Ans. (a) (i) is correct]


3. (a) Unary operators require one operand
7. STATEMENT : (b) Binary operator requires two operands
(i) Keywords have special meaning to the (c) Ternary operator requires three operands.
w

language compiler. (d) Many operators requires many operands.


(ii) These are reserved words for special purpose.  [Ans. (d) Many operators requires many
(iii) These words cannot be used as normal operands]
w

identifi ers.
(iv) Identifi ers are also called as constant. Very Short Answers 2 MARKS
(a) (iv) is correct
w

1. What is the use of preprocesser directive statement


(b) (i) and (iv) are correct
in a c++ program?
(c) (i) and (iii) are correct
Ans. It tells the compiler's preprocessor to include the
(d) (i), (ii) and (iv) are correct
header file in the program.
[Ans. (a) (iv) is correct]

orders@surabooks.com PH: 9600175757 / 8124201000 / 8124301000


This is only for Sample Materials
for Full Book order online and available at all Leading Bookstores
152 Sura’s  XI Std - Computer Science ➠ Volume II ➠ Unit III ➠ Chapter 9
2. What is the difference between 'a' and "a" in c++? 10. What is meant by identifiers? give example.
Ans. Characters enclosed in single quotes are character Ans. Identifiers are the user-defined names given to
constants in c++ so 'a' is a a character constant. different parts of the C++ program also called
Character enclosed in Double quotes are strong variable, These are the fundamental building blocks
constants in c++ so "a" is a string constant. of a program.

m
11. What is meant by literals?
3. What is a size of 'x' and "x"?
Ans. Literals are data items whose values do not change
Ans. The size of 'x' is 1 character where as the size of "a"
during the execution of a program. Therefore Literals
is 2 characters.

co
are called as Constants.
4. Name any four applications developed by C++ 12. Write the classification of numeric constants?
Ans. (i) Photoshop
Ans. Numeric constants are further classified as:
(ii) Maya
(i) Integer Constants / Fixed point constants
(iii) Amazon

s.
(ii) Real constants / Floating point constants
(iv) Facebook.
13. Name the three types of integer constant
5. Given the following code segment. Ans. (i) Decimal

ok
Ans. int x = 30;
(ii) Octal
cout << ++ x ;
(iii) Hexadecimal
cout << x ;
14. Write a note on real / floating point constant.
a. What output does the above code segment produce?
Ans. A real or floating point constant is a numeric constant
Answer a .31
o
b.What is the output when ++x replaced x+1;
having a fractional component. These constants may
31 be written in fractional form or in exponent form.
ab
b. 31 15. Name the parts of Exponential form of real
30 constant
Ans. Exponent form of real constants consists of two
6. Write any two difference between c and C++. parts: (1) Mantissa and (2) Exponent
ur

16. What is the use of boolean literals?


Ans. C C++
Ans. Boolean literals are used to represent one of the
1. C is a subset of C++ 1. C++ is superset of C Boolean values (True or false). Internally true has
2. No data hiding 2. Encapsulation hides value 1 and false have value 0.
.s

data
17. Define character constant.
7. What is character set?
Ans. A character constant in C++ must contain one
Ans. Character set is the set of characters which are allowed
character and must be enclosed in a single quote
w

to write a C++ program. A character represents any


Valid character constants : 'A', '2', '$'
alphabet, number or any other symbol.
8. Name any four C++ keywords. 18. Write the function of the escape sequence for the
w

following (i) \a (ii)\t (iii) \n (iv) \o


Ans. (i) Switch
Ans. (i) \a - alert bell (ii) \t - Horizontal tab
(ii) it
(iii) \n - Newline (iv) \0 - Null
(iii) for
w

(iv) while 19. Define operator and operands.


Ans. The symbols which are used to do some mathematical
9. Name any four recent list of keywords added in
and logical operations are called as "Operators". The
C++.
data items or values that the operators act upon are
Ans. (i) name space (ii) using
called as "Operands".
(iii) true (iv) false

orders@surabooks.com PH: 9600175757 / 8124201000 / 8124301000


This is only for Sample Materials
for Full Book order online and available at all Leading Bookstores
Sura’s  XI Std - Computer Science ➠ Introduction to C++ 153

20. Given the following expression find the result if 29. Name the kinds of literals used in C++.
the value of a = 5, b = 6, c = 7: Ans. There are different kinds of literals used in C++
(i) (a > b) && (b < c) (Integer, Float, Character, String)
(ii) (a = = b) && (b > c)
30. What are punctuators?
(iii) ! (a > b)
Ans. Punctuators are symbols, which are used as delimiters
Ans. (i) 0 (false)

m
in constructing C++ programs. They are also called
(ii) 0 (false) as "Separators"
(iii) 1 (true)
31. What do you mean by precedence of operators?

co
21. Name the three kinds of bitwise operator. Ans. The hierarchical order in which the operators are used
Ans. (i) Logical bitwise operators for operation is known as precedence of operators.
(ii) Bitwise shift operators 32. Differentiate unary and binary operators.
(iii) One's compliment operators

s.
Ans. Unary operators Binary operators
22. Identify the type of operator for the following
(i) % (ii) & (iii) >> (iv) + = It performs operation It performs operation on
on single operand two operands
Ans. (i) Arithmetic operator

ok
(eg) ++, -- (eg) +, -, *
(ii) Bitwise And Operator
(iii) Bitwise Shift Right Operator 33. What are the values of m and n when the following
(iv) Shorthand assignment operator statements are executed?
int a = 53, b = 26
o
23. What is the use of comma operator in C++?
boolean m = (a>b) ? a:b;
Ans. Comma ( , ) is an operator in C++ used to string int (a<b) ? a: b;
ab
together several expressions. The group of expression
Ans. The statement m = (a >b) ? a: b is wrong. It should be
separated by comma is evaluated from left to right.
m = (a > b) ? true : false ; then
24. Name the operators which is specific to C++. m = true
Ans. : : Scope access / resolution n = 26
ur

(i) Dereference
34. What will be result stored in a after evaluating the
(ii) Dereference pointer to class member following expressions?
25. Write a note on comment statement. int a = 4;
.s

Ans. All statements that being with // are treated as a + = (a++) + (++a) + a;
comments. Comments are simply ignored by Ans. a = 20
compilers. i.e., compiler does not execute any 35. What is the difference between '/' and '%'
w

statement that begins with a // operator?


26. What is meant by cascading of operator? Ans. (i) The '/' operator results in quotient when a
number is divided by other number.
w

Ans. The multiple use of input and output operators


such as >> and <<in a single statement is known as (ii) The'%' operator results in remainder when a
cascading of I/O operators. number is divided by other number.
36. What will be the output of the following code?
w

27. What is the use of return statement?


int i = 6, j = 10;
Ans. return is a keyword which is used to return the value
i+ = i++ - ++ j + i ;
what you specified to a function.
Cout <<"i = " << i;
28. Name any tour familiar C++ compilers with IDE Cout << "j = " << j;
Ans. Dev C++, Eclipse, Net Beans, Code::blocks, Digital Ans. i = 7
Mars, Sky IDE, Code Lite j = 11

orders@surabooks.com PH: 9600175757 / 8124201000 / 8124301000


This is only for Sample Materials
for Full Book order online and available at all Leading Bookstores
154 Sura’s  XI Std - Computer Science ➠ Volume II ➠ Unit III ➠ Chapter 9
37. What will be the result of following two expressions 46. What is the use of relational operator?
if i = 20 initially? a) ++i < = 20 (b) i++ < = 20 Ans. Relational operators are used to determine the
Ans. (a) false (b) true relationship between its operands. When the
38. We have two variable A and B. Write C++ relational operators are applied to two operands, the
statements to calculate the result of division of B result will be a Boolean value. 1 or 0 represents True
by A and calculate (a) Quotient of the division (b) or False respectively.

m
remainder of the division? 47. Write a note on ++ and -- operator?
Ans. (a) B/A (b) B%A Ans. ++ (Plus, Plus) Increment Operator. – –(Minus,
39. Write the output of the following code. Minus) Decrement operator. An increment or

co
int i = 20; decrement operator acts upon a single operand and
int n = i ++ % 5; returns a new value. Thus, these operators are unary
Ans. i = 11 operators. The increment operator adds 1 to its
n=0 operand and the decrement operator subtracts 1 from

s.
its operand.
40. What is the value of i of the following code
executes? 48. What is meant by non-graphical characters?
a) int i = 8; b) int i = 17 Ans. Non-printable characters are also called as non-

ok
int n = i >>=2; i >>=1; graphical characters. Non-printable characters are
Ans. a) 2 those characters that cannot be typed directly from a
b) 8. keyboard during the execution of a program in C++.
41. Write a note on Dev C++.
o 49. If a= 58, find a = a++ + ++a;
Ans. Dev C++ is an open source, cross platform (alpha a = a++ + ++a
version available for Linux), full featured Integrated Ans. a = 58 + 60 = 118
Development Environment (IDE) distributed GNU
ab
50. If m = 12, then find n = m++ * 5 + – – m;
General Public Licence for programming in C and
C++. It is writtern in Delphi. Ans. n = m++ * 5 + – –m
= 12 * 5 + 12
42. Define <iostream.h>.
= 60 + 12 = 72
Ans. iostream header file contains the definition of its
ur

member objects cin and cout. If not included iostream 51. If a = 4, b = 3; find the value of
in your program, an error message will occur on cin c=a++ *6 + ++b*5+10;
and cout; and we will not be able to get any input or Ans. c = a++ *6 + ++b*5+10
send any output.
.s

= 4 * 6 + 4×5 + 10
43. What is the purpose of using preprocess statement = 24+20+10 = 54
in C++?
52. If a= 12, b=8, find the value of
Ans. The C++ programs being with include statements
w

starting with a # (hash / pound). The symbol # is a a * = ++a/6 + b ++%3;


directive for the preprocessor. That means, these Ans. a* = ++ a/6+ b++ %3;
statements are processed before the compilation = a* (++a/6 + b++%3) = 12*(13/6 + 8% 3)
w

process begins. = 12 * (2+2) = 48


44. Write a note on size of () operators. 53. Indicate whether the following statements result
Ans. It is called as compile time operator. It returns the in True or False?
w

length of a variable in bytes. (i) 5+3 > 7 && 7> = 4+3


45. Write a note on bitwise one's compliment (ii) 3= = 4 && 5 = = 5
operator? (iii) 3 > 0 ¦ ¦ 0 < – 14
Ans. The bitwise One's compliment operator ~ (Tilde), Ans. (i) True (ii) false (iii) True
inverts all the bits in a binary pattern, that is, all
1's become 0 and all 0's become 1. This is an unary
operator.

orders@surabooks.com PH: 9600175757 / 8124201000 / 8124301000


This is only for Sample Materials
for Full Book order online and available at all Leading Bookstores
Sura’s  XI Std - Computer Science ➠ Introduction to C++ 155

54. What do you mean by precedence of operators? 63. What are the types of casting show in by the
Ans. The hierarchical order in which the operators are used following examples?
for operation is known as precedence of operator. a. double x = 72.5;
in+y=(int)x;
55. Why do you want to declare an identifier as int
datatype? b. int x =24;
long y = 3;

m
Ans. Integer data type accepts and returns only integer
numbers. If an identifier is declared as an int, C++ Ans. a : Explicit type casting
compiler allows storing only integer values into it. b : Implicit type casting

co
56. Write the use of declaring in identifier as float? 64. State one difference between floating point literal
Ans. Float data type is used to produce more accurate and double type literal.
results. Floating point numbers can also be written in Ans. Floating point literal is a fractional number with
exponent notation. sort precision and can range the values from – 3.4
57. What is use of double data type? E+38 to 3.4E+38, where as double type literal is

s.
Ans. The double is also used for handling floating point used for dons precisions and can range the values for
numbers. But, this type occupies double the space –1.7E+308 to 1.7E+308
than float type. This means, more fractions can be 65. State the values of n and ch?

ok
accommodated in double than in float type. The
double is larger and slower than type of float. char c= 'B';
int n = c+1;
58. Name the Modifiers you can use with Integer data
char ch = (char)n;
type?
value of
Ans. short, unsigned short, signed short, int, unsigned int,
signed int, long, unsigned long
o Ans. (i) n = 67 (ii) ch = c

59. How will you declare more than one variable in a 66. What are fundamental datatypes? Write there
ab
single statement? write the syntax example. types.
Ans. Declaration of more than one variable: More than one Ans. Fundamental (atomic) data types are predefined data
variable of the same type can be declared as a single types available with C++. There are five fundamental
statement using a comma separating the individual data type in C++: char, int, float, double and void.
variables. Actually, these are the keywords for defining the data
ur

Syntax : <data type> <var1>, <var2>,<var3>.....<var_n>; types.


Example : int num1, num2, sum; 67. Name the classification of datatypes in C++.
60. What is known as Access Modifier? Ans. In C++, the data types are classified as three main
.s

Ans. keyword modifiers / restricts the accessibility of a categories (1) Fundamental data types (2) User-
variable. So, it is known as Access modifier. defined data types and (3) Derived data types.
61. What is the error message display by Turbo 68. What is datatypes?
w

compiler while executing the following code Ans. A datatype is a classification of the type of data that a
const x = 200; variable can hold in computer programming
x = x=1;
w

69. Write the advantages of using float datatype?


cout<< x; Ans. There are two advantages of using float data types.
Ans. Turbo compiler - cannot modify the const object (1) They can represent values between the integers
Dev C++ - assignment of read only memory num
w

(2) They can represent a much greater range of


62. Write the Syntax of declaring reference variable. values.
Ans. Syntax: 70. Write the disadvantages of using float datatype.
<type><&reference_variable> = <original_variable> Ans. Floating point operations are slower than integer
operations. This is a disadvantage of floating point
numbers.

orders@surabooks.com PH: 9600175757 / 8124201000 / 8124301000


This is only for Sample Materials
for Full Book order online and available at all Leading Bookstores
156 Sura’s  XI Std - Computer Science ➠ Volume II ➠ Unit III ➠ Chapter 9
71. Write a note on void datatype. 78. What is meant by Declaration?
Ans. The literal meaning for void is 'empty space'. Here, Ans. Declaration is a process to instruct the compiler to
in C++, the void data type specifiers an empty set of allocate memory as per the type that is specified
values. It is used as a return type of functions that do along with the variable name.
not return any value.
79. What is meant by junk or garbage values?

m
72. What is the reason of declaring variables? Ans. Declaring a variable without any initial value,
Ans. The most important reasons for declaring a variable the memory space allotted to that variable will be
as a particular data type is to allocate appropriate occupied with some unknown value. These unknown
space in memory. As per the stored program concept, values are called as "Junk" or "Garbage" values.

co
every data should be accommodated in the main
80. What is Initialization? Give example.
memory before they are processed. So, C++ compiler
Ans. Assigning an initial value to a variable while that
allocates specific memory space for each and every
data handled according to the compiler's standards. variable is declared is called as "Initialization"
Examples:

s.
73. What is the use of modifier? int num = 100;
Ans. Modifiers are used to modify the storing capacity of float pi = 3.14;
a fundamental data type except void type. Modifiers double price = 231.45;

ok
can be used to modify (expand or reduce) the memory
allocation of any fundamental data type. They are 81. What is Dynamic Initialization? Give Example.
also called as Qualifiers. Ans. A variable can be initialized during the execution of
74. Name the four modifiers used in C++. a program. It is known as "Dynamic initialization"/
int sum = num1+num2
(1) signed
o
Ans. There are four modifiers used in C++. They are:
82. What is use of Manipulators?
Ans. Manipulators are usd to format the output of any C++
ab
(2) unsigned
(3) long program. Manipulators are functions specifically
(4) short designed to use with the insertion (<<) and extraction
operators.
75. What is the use of suffixes for integer and floating
83. Name the commonly used manipulators in C++
ur

point numbers?
Ans. The Commonly used manipulators are: endl, setw,
Ans. There are different suffixes for integer and floating
point numbers. Suffix can be used to assign the same setfill, setprecision and setf.
value as a different type. For example, to store 45 in 84. Write the members of iomanip.h.
.s

an int, long, unsigned int and unsigned long int, use Ans. setw, setfill, setprecision and setf manipulators are
suffix letter L or U (eigther case) with 45 i.e. 45L or members of iomanip header life.
45U. This type of declaration instructs the compiler
to store the given values as long and unsigned. 85. Write a note on endl
w

Ans. endl is used as a line feeder in C++. It can be used


76. What are the two values associated with a as an alternate to'\n', in other words, endl inserts a
symbolic variable? new line and then makes the cursor to point to the
w

Ans. There are two values associated with a symbolic beginning of the next line.
variable; they are R-value and L-value.
86. Differentiate endl and '\n'.
R-value is data stored in a memory location
w

Ans. (i) endl - Inserts a new line and flushes the buffer
L-value is the memory address in which the
R-value is stored. (Flush means - clean).
(ii) '\n'- Inserts only a new line.
77. Define variable.
Ans. Variables are used-defined names assigned to specific
memory location in which the values are stored.

orders@surabooks.com PH: 9600175757 / 8124201000 / 8124301000


This is only for Sample Materials
for Full Book order online and available at all Leading Bookstores
Sura’s  XI Std - Computer Science ➠ Introduction to C++ 157

87. Write a note on setfill() manipulator. 95. Can we consider char as an integer datatype? If
Ans. setfill ( ) : This manipulator is usually used after yes, Why?
setw. If the presented value does not entirely fill the Ans. Yes, char can be treated as an integer datatype in the
given width, then the specified character in the setfill sense that at memory level it is stored as one byte
argument is used for filling the empty fields. which is same size as short integer data type. For
example: char ch='A' and char ch=65 statements are

m
88. Write a note on setprecision() manipulator. equal.
Ans. (i) setprecision ( ) : This is used to display numbers Short Answers 3 MARKS
with fractions in specific number of digits.

co
1. Write a note on history of C++
(ii) Syntax : setprecision (number of digits);
setprecision can also be used to set the number Ans. C++ was developed by Bjarne Stroustrup at AT &
of decimal places to be displayed. In order T Bell Laboratory during 1979. C++ is originally
to do this task, to set an ios flag within setf() derived from C language and influenced by many

s.
manipulator. This may be used in two forms: languages like Simula BCPL, Ada, ML, CLU and
(i) fixed and (ii) scientific. ALGOL 68. Till 1983, it was referred "New C" and
89. What is an expression? "C with Classes". In 1983, the name was changed as

ok
Ans. An expression is a combination of operators, C++ by Rick Mascitti.
constants and variables arranged as per the rules of
C++. It may also include function calls which return 2. Write the rules for naming an identifier.
values. o Ans. Rules for naming an identifer:
90. What is pointer variable? ‰‰The first character of an identifier must been
Ans. A Pointer is a variable that holds a memory address. alphabet or an underscore (_)
ab
‰‰Only alphabets, digits and underscore are
Pointer declaration statements.
permitted. Other special characters are not
91. What is Type conversion? Name the types of allowed as part of a name.
conversion? ‰‰Uppercase and lowercase letters are considered

Ans. The process of converting one fundamental type differently


ur

into another is called as "Type Conversion". C++ ‰‰Reserved words or keywords cannot be used as an

provides two types of conversions (1) Implicit type identifier name.


conversion and (2) Explicit type conversion. 3. Why the following identifiers are invalid? Give
.s

92. What is Type promotion? reason (i) num-add (ii) This (iii) 2myfile
Ans. If the datatype of the operands differ, the compiler Ans.
Identifiers Valid/ Reason for invalid
converts one of them to match with the other, using Invalid
w

the rule that the "smaller" type is converted to the num-add Invalid Contains special
"wider" type, which is called as "Type Promotion" character (-)
93. What is type casting? This Invalid This is one of the
w

keywords. Keywords
Ans. C++ allows explicit conversion of variables or
cannot be used as
expressions from one data type to another specific identifier names.
data type by the programmer. It is called as "type
w

2myfile Invalid Name must start


casting". with an alphabet or
94. Name some derived datatypes in C++. anunderscore
Ans. Array, Function, Pointer, Reference.

orders@surabooks.com PH: 9600175757 / 8124201000 / 8124301000


This is only for Sample Materials
for Full Book order online and available at all Leading Bookstores
158 Sura’s  XI Std - Computer Science ➠ Volume II ➠ Unit III ➠ Chapter 9
4. Tabulate the relational operator. b. if x = 4; find the value of a * = ++ a/6 + b++ %3;
Ans. Operator Operation = 12 * (++ a/6 + b++%3);
> Greater than = 12 * (13/6 + 8%3) = 12 * (2+2) = 48
< Less than 10. Rewrite the following program segment using if-
>= Greater than or equal to else statement.

m
<= Less than or equal to Com = (sales > 15000) ? sale A5/100 : 0;
== Equal to Ans. if (sales > 15000)
!= Not equal com = sales * 5/100;

co
5. Write a note on conditional operator. else
Ans. In C++, there is only one conditional operator that is com = 0;
used. ?: is a conditional Operator. This is a Ternary 11. What are the characters used in C++?

s.
Operator. This operator is used as an alternate to if...
Ans. Alphabets A .... Z, a ....z
else control statement
Numeric 0 .... 9
6. Write a note on input operator.

ok
Special Characters +-*/~!@#$%^
Ans. (i) Input operator C++ provides the operator>>to & [] () {} => < _ \ | ?
get input. It extracts the value through the .,:'";
keyboard and assigns it to the variable on its White space Blank space, Hori-
right;hence, it is called as "Streamextraction" or zontal tab, Carriage
"getfrom" operator.
o return, Newline, Form
(ii) It is a binary operator i.e., it requires two feed
ab
operands. The first operand is the pre-defined Other characters C++ can process any
identifier cin(pronounced as C-In) that of 256 ASCII charac-
identifieskeyboard as the input device. The ters as data
second operand must be a variable.
12. What is the use of assignment operators?
ur

7. Give the output, if the following statement is Ans. Assignment operator is used to assign a value
executed: to a variable which is on the left hand side of an
C = (val + 550 < 1700)? 200 : 400; assignment statement = (equal to) is commonly
used as the assignment operator in all computer
if a. val = 1000
.s

programming languages. This operator copies the


b. val = 1500
value at the right side of the operator to the left side
Ans. a.c = 200 variable. It is a binary operator.
b.c = 400
w

13. Indicate whether the following statements results


8. What is an operator? What are the three main in True or false.
(i) 4 > 7 ¦ ¦ 7 > 15
types of operators? Name them.
(ii) 5 + 3 > 7 & & 7 > = 4 + 3
w

Ans. An operator is basically a symbol or token which


(iii) ! (5 < 3)
performs arithmetical or logical operations and
Ans. (i) False (ii) True (iii) True
gives meaningful result. The three types of operator
w

14. What is association?


Arithmetic operator, logical operator, Relational
Ans. Operators are executed in the order of precedence.
operator. The operands and the operators are grouped in a
9. a. If a = 4, b = 3, find the value of c = a ++ * 6 + specific logical way for evaluation. This logical
grouping is called as an Association.
++b * 5 + 10;
Ans. C = a++ * 6 + ++b * 5 + 10
= 4 * 6 + 4 * 5 + 10 = 24 + 20 + 10 = 54

orders@surabooks.com PH: 9600175757 / 8124201000 / 8124301000


This is only for Sample Materials
for Full Book order online and available at all Leading Bookstores
Sura’s  XI Std - Computer Science ➠ Introduction to C++ 159

15. What is the purpose of "Using namespace std"; {


statement? cout << "\n Enter Number 1: ";
Ans. The line using namespace std; tells the compiler to use cin >> num1;
standard namespace. Namespace collects identifiers cout << "\n Enter Number 2; ";
used for class, object and variables. Namespcaes cin >> num2;
provide a method of preventing name conflicts in sum = num 1 + num2;

m
large projects. It is a new concept introduced by the cout << "\n The sum of" << num 1 << " and " <<
ANSI C++ standards committee. " is " << sum;
16. Distinguish between a unary, a binary and a return 0;

co
ternary operator? Give examples for each one at }
them?
Ans. A unary operator requires a single operands eg.++,-- 23. Write a C++ program to get the following output
format
A binary operator requires two operands eg.%,/,*
Enter a character : a
A ternary operator requires three operands eg.? :

s.
The Next character : c
17. What type of constant are the following: 15, 012, Ans. #include <iostream>
0x2B, 17, 014, "a"?
using namespace std;

ok
Ans. 15, 17 are Integer constant
int main()
012, 017 are octal constant
Ox2B hexadecimal constant {
"a" is string constant char ch;
cout << "\n Enter a character: ";
o
18. What kind of program elements are the following:
cin >> ch;
13, 'b', 4.38, "b", main ( )?
ch = ch = 2;
ab
Ans. 13 - Integer constant
cout << "\n The Next character: " << ch;
'b' - Character constant
return 0;
"b" - String constant
}
4.38 - floating point constant
main () - function 24. Write a C++ program to find the area of circle?
ur

Ans. #include <iostream>


19. State the escape sequences for horizontal tab and
new line feed using namespace std;
Ans. Escape sequences for horizontal tab is "\t" and for int main()
.s

new line is "\n" {


20. Name two different styles of expressing a comment float r, area;
in C++ programing cout << "\n Enter Radius: ";
w

Ans. (i) Single line comment cin >> r;


(ii) Multiline comment area = 3.14 * r* r;
w

21. Define the term (i) Source code (ii) object code. cout << "\n The Area of the circle is" << area;
Ans. (i)  Source code - A program written High level return 0;
language }
(ii) Object code - Source code converted in to
w

25. What do you mean by type conversion? How


Machine Readable code is called object code. is implicit conversion different from explicit
22. Write a C++ program to find the sum of two conversion?
integer numbers? Ans. (i) In a mixed expression the result must be obtained
Ans. #include <iostream> into a specific datatype. For this purpose, the
using namespace std; datatype need to be converted into the required
int main() type. It is known as type conversion.

orders@surabooks.com PH: 9600175757 / 8124201000 / 8124301000


This is only for Sample Materials
for Full Book order online and available at all Leading Bookstores
160 Sura’s  XI Std - Computer Science ➠ Volume II ➠ Unit III ➠ Chapter 9
(ii) In an implicit type conversion, the result of a GoLive,
mixed made expression is obtained in to the Frame (mostly C, some C++)
higher most data type without any intervention (iii) Maya - 3D Animation Multimedia software has
of the user.
been used in the production of every major film
Eg: int a; float b; float c;
involving computer generated effects including
C= a+b;

m
Star wars, Spider Man, Lord of the Rings, Stuart
(iii) In case of explicit type conversion, the data gets Little etc.,
converted to another type as per user's choice.
(iv) Amazon.com - Large scale e-commerce
Eg: int a; float b; double c;

co
application
b = (float) (a*c);
(v) Amadeus : running the biggest non-military
26. Differentiate float type and double type datacenter in Europe (in excess of 5000
intiatigations? transactions per second, 2,00,000 terminals
Ans. (i) A float type variable is initialized with a connected, 24/7 operation) is doing most of its

s.
fractional value such as 0.0L where as a double current development in C++. All Unix - based
type variable is initialized with a fractional value server applications are completely C++. Some
as 0.0D. The difference between initialized is of them :

ok
the suffir L and D respectively
Car reservation
(ii) Eg : float a = 0.0f;
double x = 0.0D; Customer profile server
Electronic ticketing
27. What is an expression? o TCP /IP front end
Ans. An expression in C++ is any valid combination
(vi) Facebook - Several high performance and high
of operators, constants and variables ie., a legal
reliability components
combination of C++ tokens.
ab
2. Differentiate C and C++.
28. Name the type of error (syntax, runtime or logical
& error) in each case given below: Ans.
C C++
(i) Division by a variable that contains a value of 0
C is a subset of C++ C++ is a superset of C
ur

(ii) Multiplication operator used when the


operation should be division Supports Supports both
(iii) Missing Semicolor. Procedural Procedural and Object
.s

Programming Oriented Programming


Ans. (i) Runtime error (ii) logical error (iii) syntax error. paradigms. So, C++ is
Paradigm also called as
Long Answers 5 MARKS "Hybrid Language
w

Data and Functions Data and functions are


1. Explain any five familion applications developed are separate and free encapsulated together in
by C++? entities form of an object
w

Ans. (i) Android - Famous Operating system for smart No Data hinding Encapsulation hides data
phones developed by Java and C++
(ii) Adobe Systems - All major applications are Function driven Object driven
w

developed in C++ language language


Photoshop & ImageReady Does not have Uses namespace which
namespace feature avoid name collision
Illustrator
Acrobat,
InDesign,

orders@surabooks.com PH: 9600175757 / 8124201000 / 8124301000


This is only for Sample Materials
for Full Book order online and available at all Leading Bookstores
Sura’s  XI Std - Computer Science ➠ Introduction to C++ 161

scanf and printf cin and cout objects 


Note: If a Decimal constant with fractions, then
functions are used for are used for input and the compiler will take only the integer part of the
input and output value and it will ignore its fractional part. This is called
output as "Implicit Conversion". It will be discussed late.
Not support Supports reference For example: If you assign 4.56 as an integer

m
reference variable variable decimal constant, the compiler will accept only the
Not support virtual and Supports virtual and integer portion of 4.56 ie. 4. It will simply ignore.56.
friend functions friend functions (ii) Octal :

co
No Exception Supports exception 1. Any sequence of one or more octal values
handling handing (0 ...7 ) that starts with 0 is considered as an
3. Write the benefits of C++. Octal constant.
Ans. (i) C++ is highly portable language and is often 2. It may or may not be signed.

s.
the language of choice for multi-device, multi- 3. Decimal points(Dot), Commas and blank spaces
platform app development. are not allowed as part of it.
(ii) C++ is an object-oriented programming Invalid Octal

ok
language and includes classes, inheritance, Valid Octal
constants
polymorphism, data abstraction and 012 05,600 (Comma is not allowed)
encapsulation.
-027 04.56(Decimal point is not
(iii) C++ has a rich function library
allowed)
(iv)
o
C++ allows exception handling, and function
overloading which are not possible in C.
+0231 0158 (8 is not a permissible digit
in octal system)
(v) C++ is a powerful, efficient and fast language.
ab
When you use a fractional number that beings with
It finds a wide range of applications from GUI
0, it will be considered as on integer number not as
applications to 3D graphics for games to real-
Octal.
time mathematical simulations.
(iii) Hexadecimal : Any sequence of one or more
4. Explain the types of integer constants.
ur

Hexadecimal values (0 ... 9, A .... E) that starts


Ans. Integer Constants / Fixed point constans:
with Ox or OXis considered as a Hexadecimal
Integers are whole numbers without any
fractions. An integer constant must have at constant. All Hexadecimal values are unsigned.
least one digit without a decimal point. It may Decimal points(Dot), Commas and blank spaces
.s

be signed or unsigned. Signed integers are are not allowed as part of it.
considered as negative. In C++, there are three
Valid Hexadecimal Invalid Hexadecimal
w

types of integer constants:


constants constants
(i) Decimal :
0 ×123 0 ×1,A5 (Comma is not
1. Any sequence of one or more digits (0.....9) allowed)
w

2. It may or may not be signed. 0 × 568 0 ×.14E(Decimal point


3. Comma and blank spaces are not allowed as is not allowed)
part of it. -0 × 8E55 (Sign not
w

Valid Decimal Invalid Decimal constants allowed)


constants
5. Explain the steps in creating and executing C++
725 7,500 (Comma is not allowed)
program.
-27 5 66(Blank space is not
allowed) Ans. For creating and executing a C++ program, one must
4.56 follow four important steps.

orders@surabooks.com PH: 9600175757 / 8124201000 / 8124301000


This is only for Sample Materials
for Full Book order online and available at all Leading Bookstores
162 Sura’s  XI Std - Computer Science ➠ Volume II ➠ Unit III ➠ Chapter 9
(i) Creating Source code : Creating includes 7. Explain the uses of logical operators in C++.
typing and editing thevalid C++ codeas per the Ans. A logical operator is used to evaluate logical and
rules followed by the C++ Compiler relational expressions. The logical operators act
(ii) Saving source code with extension .cpp : upon operands that are themselves called as logical
After typing, the source code should be saved expressions. C++ provides three logical operators.

m
with the extension .cpp Operator Operation Description
(iii) Compilation : This is an important step The logical AND
combines two different
in constructing a program. In compilation, relational expressions into

co
compiler links the library files with the source && AND one. It returns 1 (True),
code and verifies each and every line of code. If if both expression are
true, otherwise it returns 0
any mistake or error is found, it will inform you (flase).
to make corrections. If there are no errors, it The logical OR combines

s.
translates the source code into machine readable two different relational
object file with an extension .obj expressions into one. It
(iv) execution : This is the final step of returns 1 (True), if either
││ OR

ok
construction of a C++ Program. In this stage, one of the expression is
true. It returns 0 (false),
the object file becomes an executable file with
if both the expression are
extension .exe. Once the program becomes an false.
executable file, the program has an independent NOT works on a single
o
existence. This means, you can run your expression / operand. It
application without the help of any compiler or simply negates or inverts
ab
IDE. the truth value. i.e., if an
! NOT
6. Explain increment and decrement operator with operand / expression is 1
an example. (true) then this operator
Ans. returns 0 (false) and vice
versa
ur

Example (Assume n=2;


Operator Operation what will be value of n) 8. Explain logical bitwise operator with an example.
Prefix Postfix Ans. (i) Logical bitwise operators:
++n; n++; & Bitwise AND (Binary AND)
.s

n= n+1; Value of │ Bitwise OR (Binary OR)


Value of n; n; ^ Bitwise Exclusive OR (Binary XOR)
++ Increment
n= n+1; (i) Bitwise AND (&) will return 1 (True) if both
w

Value of n = 3 Value of the operandsare having the value 1 (True);


n= 2 Otherwise, it will return 0 (False)
– –n; n– –; (ii) Bitwise OR (│) will return 1 (True) if any one
w

of the operandsis having a value 1 (True); It


n=n–1; Value of
returns 0 (False) if both the oprands are having
–– Decrement
Value of n; n; the value 0 (False).
n=n–1;
w

(iii) Bitwise XOR (^) will return 1 (True) if only


Value of n = 1 Value of one of the operandis having a value 1 (True). If
n= 2 both are True or both are False, it will return 0
(False).
Truth table for bitwise operators (AND, OR,
XOR).

orders@surabooks.com PH: 9600175757 / 8124201000 / 8124301000


This is only for Sample Materials
for Full Book order online and available at all Leading Bookstores
Sura’s  XI Std - Computer Science ➠ Introduction to C++ 163

A B A&B A|B A^B Separator Description


1 1 1 1 0 Opening and closing curly
braces indicate the start and
0 0 0 1 1 the end of a block of code.
0 1 0 1 1 A block of code containing
Curly braces { } more than one executable

m
0 0 0 0 0 statement. These statements
Example: together are called as
If a = 65, b=15 "compound statement"
Equivalent binary values of 65 = 0100 0001; Opening and closing

co
parenthesis indicate
15 = 0000 1111 Parenthesis ( ) function calls and function
Operator Operation Result
parameters
a 0 1 0 0 0 0 0 1
b 0 0 0 0 1 1 1 1 Square It indicates single and
& a&b
a&b 0 0 0 0 0 0 0 1
brackets [ ] multidimensional arrays.

s.
(a&b) = 0000 00012= 110
It is used as a separator in
a 0 1 0 0 0 0 0 1 Comma ,
| a|b
b 0 0 0 0 1 1 1 1 an expression
a|b 0 1 0 0 1 1 1 1
Every executable statement

ok
(a|b) = 010011112= 7910
Semicolon ; in C++ should terminate
a
b
0
0
1
0
0
0
0
0
0
1
0
1
0
1
1
1
with a semicolon
^ a^b
a^b 0 1 0 0 1 1 1 0 It is used to label a
(a^b) = 0100 11102= 7810 Colon :
o statement
9. Explain Bitwise Shift operator with an example All statements that begin
with // are treated as
Ans. (i) The Bitwise shift operators: There are two Comments comments. Comments are
ab
bitwise shift operators in C++, Shift left ( << ) simply ignored by compilers.
and Shift right (>>). i.e., compiler does not
// execute any statement that
(ii) Shift left ( << )- : The value of the left operandis
begins with a //
moved to left by the number of bits specified by // Single line comment
/* */
the right operand. Right operand should be an
ur

/* .............*/ Multiline
unsigned integer. comment
(iii) Shift right ( >> )- : The value of the left operand 11. Write a C++ program to find C.S.A of a cylinder
is moved to right by the number of bits specified
(CSA = 2πrh)
.s

by the right operand. Right operand should be


Ans. #include <iostream>
an unsigned integer.
using namespace std;
Example :
int main()
w

If a = 15; Equivalent binary value of a is 0000 1111 {


Operator Operation Result float pi = 3.14, radius, height, CSA;
cout << "\n Curved Surface Area of a cylinder";
a 0 0 0 0 1 1 1 1
w

cout << "\n Enter Radius (in cm): ";


a << 3 0 1 1 1 1 0 0 0
<< a << 3 cin >> radius;
(a<< 3) = 011110002=12010 cout << "\n Enter Height (in cm): ";
cin >> height;
w

CSA = (2*pi*radius)*height;
10. Explain the punctuators used in C++. system("cls");
Ans. Punctuators are symbols, which are used as cout << "\n Radius: " << radius << " cm ";
delimiters, while constructing aC++ program. cout << "\n Height: " << height << " cm ";
They are also called as "Separators". The following cout << "\n Curved Surface Area of a Cylinder is
punctuators are used in C++; most of these symbols  " << CSA << " sq.cm ";
are very similar to C and Java. }

orders@surabooks.com PH: 9600175757 / 8124201000 / 8124301000


This is only for Sample Materials
for Full Book order online and available at all Leading Bookstores
164 Sura’s  XI Std - Computer Science ➠ Volume II ➠ Unit III ➠ Chapter 9
12. Write a C++ program to find the perimeter and p = 5000; r=10; t=2;
area of a Semicircle. amt = p * (pow (1+r/100,t);
Ans. #include <iostream> ci = amt - p;
using namespace std; si=p*r*t/100;
int main() d=ci-si;
{ cout << "The compount interest=" <<(float) ci <<

m
int radius; endl";
float pi = 3.14; cout << "The simple interest=" << si << endl";
cout << "\n Enter Radius (in cm): "; cout << "The difference between C.I and SI="

co
cin >> radius;  <<(float) d << endl";
float perimeter = (pi+2)*radius; }
float area = (pi*radius*radius)/2; 15. Write a C++ program that initializes three
 cout <<"\n Perimeter of the semicircle is variable namely hours worked, Pay rate and

s.
 "<<perimeter <<" cm"; tax rate and the calculates and prints payment
cout << "\n Area of the semicircle is " << area << amount and Tax payable as hours worked x pay
 " sq.cm "; rate and payment amount x tax rate respectively.
} Ans. #include <iostream.h>

ok
void main ( )
13. Write a program to find the area, perimeter and
diagonal of a rectangle. {
int hw = 50;
Ans. #include <math.h>
double pr =40.0;
#include <iostream.h>
void main ( )
o double tr = 0.20;
cout << "Hours Worked" <<hw << endl";
{ cout << "Payment Amount" << (hw*pr) << endl";
ab
int l, b, ar, p; cout << "Tax payable" <<(hw*pr&tr) << endl";
double d; }
l = 20; b = 10;
16. Write a program that compute sum of three given
ar = l * b; numbers and find the largest of the three.
ur

p = 2 * (l+b); Ans. #include <iostream.h>


d = sqrt (l*&+b*b); void main ( )
cout << "The area of rectangle" << ar << endl"; {
cout << "The perimeter of rectangle" << p << endl"; int a = 3, b =7, c=1;
.s

cout << "The diagonal of rectangle" << d << endl"; int large , sum;
} cout << "Sum of" <<a << "and"<< b<< "and" <<C<<
14. Write a program to find the difference between  "is"<< sum;
w

Simple Interest and Compound Interest when large = ((a>b)? ((a>c) ? a: c) : ((b>c) ? b: c));
Principal, Rate and Time are given, (Principal = cout << "Largest of " <<a<< ","<<b<< "&"<< C <<
500, Rate = 10, Time = 2)  " is" <<large;
w

Ans. #include <iostream.h> }


#include<math.in>
17. Write a C++ program to convert a celius 100oC
void main ( )
to fahrenheit;
w

{
Ans. #include <iostream.h>
int p, t;
void main ( )
double r; si, amt, ci, d;
{
d = 0;
double temp (=100.0;
double tempf;

orders@surabooks.com PH: 9600175757 / 8124201000 / 8124301000


This is only for Sample Materials
for Full Book order online and available at all Leading Bookstores
Sura’s  XI Std - Computer Science ➠ Introduction to C++ 165

tempf = (temp(*1.8)+32; #include <math.h>


cout << "Faherenheit=" <<temp<< endl; void main ( )
} {
18. A cell phone manufacturing company annouces int p, b;
a special offer to their customers on purchasing  cout <<"Enter perpendicular and base of a
samsung S8 and the Samsung S9 accordingly : triangle"<<endl;

m
Ans. on Samsung S8 : Discount 15% cin>>p>>b;
on Samsung S9 : Discount 5% h=sqrt (p*p+b*b);
write a C++ program to calculate the discount, if a ar=1.0/2.0*p*b;

co
customer purchase S8 on S9 pm=(p*h*h);
#include <iostream.h> cout << "Hypotenur of the triangle=" <<h<< endl;
void main ( ) cout << "Area of the traingle=" <<ar<< endl;
{  cout << "Perimeter of the traingle=" <<pm<<

s.
int s8=60000, s9=69000; endl;
int r1=15, r2=5; }
double d1, d2, x=0, y=0; 21. Write a program in C++ to accept Employee

ok
d1 = (double) r1/100*s8; number and Basic pay. Find the gross pay of
d2 = (double) r2/100*s9; an employee for the following allowances and
x = s8–d1; deduction. Use meaningful variables:
y = s9–d2; Ans. Dearness Allowance = 25% of Basic pay
cout << "The price of samsung S8 afer discount=" House Rent Allowance = 15% of Basic pay

o <<x<< endl; Providen Fund = 8.33% of Basic pay
cout << "The price of samsung S9 afer discount=" Net pay = Basic Pay +Dearness Allowance +House
ab
 <<y<< endl; Rent Allowance
} Gross pay = Netpay - provident fund
19. Write a program in C++ to accept the number #include <iostream.h>
of days and display the result after convering in void main ( )
{
ur

to number of years, number of months and the


remaining number of days. int en;
Ans. #include <iostream.h> double basic, da, hra, pf, np, gp;
void main ( )  cout << "Enter Employee number and Basic
.s

{ Salary" << endl;


int a, b, y, m, d; cin>>en>>basic;
cout <<"Enter number of days"<<endl; basic*0.25;
w

cin>>a; hra = basic*0.15%


y=a/365; pf = basic*8.33/100;
b=a%365; gp=basic+da+hra;
w

m=b/30; np=gp–pf;
d=b%30; cout << "Employee number" <<en<< endl;
cout << "The number of years=" <<y<< endl; cout << "Gross Pay = Rs:" <<gp<< endl;
cout << "Net Pay = Rs:" <<np<< endl;
w

cout << "The number of months=" <<m<< endl;


cout << "The number of days=" <<d<< endl; }
} 22. Write a C++ program to evaluate the expresion
20. Write a program to accept perpendicular and base ( a + b )3
of a right angles traingle. Calculate and display P=
( a − b)
typotenre, area, and perimeter of the traingle.
Ans. #include <iostream.h> Ans. #include <iostream.h>

orders@surabooks.com PH: 9600175757 / 8124201000 / 8124301000


This is only for Sample Materials
for Full Book order online and available at all Leading Bookstores
166 Sura’s  XI Std - Computer Science ➠ Volume II ➠ Unit III ➠ Chapter 9
void main ( ) 25. a.  Write a program to convert the temperature
{ from Fahrenheit to celsius
double P; b.  Write a program to find the volume of a sphere
int a, b; Volume of a sphere= 4/3πr3
cout <<"Enter the value of a and b"<<endl; Ans. (a) #include<iostream.h>
cin>>a>>b;

m
void main ()
p=pow (a+b),3)/(a-b); {
cout << "The value of the expression=" <<p<< float f, c;
endl;

co
cout <<"\n Enter fahrenheit";
}
cin >> f;
23. Evaluate the following C++ expressions where c =(f–32)/1.8;
a,b,c are integers and d,e,f are floating point cout << "celsius = "<<c;
numbers, where a=5, b=3 and d=1.5 }

s.
(i) f = a+b/a
(ii) c = (a++) * d+a (b) #include<iostream.h>
(iii) c = d * a+b void main ()

ok
(iv) c = a – (b++) * (– –d) {
v) (++b) * b – a float r;
Ans. (i) f = 5 +3/5 cout <<"\n Enter radius";
= 5+0
cin >> r;
f = 5.0
o cout<<"volume of a sphere = " << ( 4/3 *
(ii) c = 5*1/5+6 = 7.5+6 = 13.6  3.14 * r*r*r);
ab
c = 13 }
(iii) c = 1/5*5+3
26. What will be the output of following programs?
= 7.5+3
(a) #include<iostream.h>
c =10
void main ()
(iv) c = 5-(3) *(0.5)
ur

{
= 5-(1-5) = 3.5
int i=10, j;
c =3
i > = 5 ? (j=10) : (j=15)
(v) f = 4*4 –5
.s

cout << "\n" <<i<<end (<<j;


= 16–5 = 11
}
f = 11.0
(b) #include<iostream.h>
24. Write the assignment statement for the following
w

{
(i) Assign b to temp int a=5, b=6;
(ii) Assign b+1 to b a = = b ? (cout<<a) : (cout<<b)
(iii) Assign d/temp to c
w

}
(iv) Assign b+c to temp Ans. (a) 10
(v) Assign temp -1 to a 10
Ans. (i) temp = b; (b) 6
w

(ii) b = b+1;
(iii) c = d/temp;
(iv) temp = b + c;
(v) a = temp –1;


orders@surabooks.com PH: 9600175757 / 8124201000 / 8124301000
This is only for Sample Materials
for Full Book order online and available at all Leading Bookstores

UNIT- III INTRODUCTION TO C++

10

m
Chapter Flow of Control

co
s.
ok
CHAPTER SNAPSHOT
 10.1. Introduction 10.4.6. Switch statement
 10.2. Statements 10.4.7. Switch vs if-else
10.2.1.
o
Null statement 10.4.8. Nested switch
ab
10.2.2. Compound (Block)  10.5. Iteration statements
statement 10.5.1. Parts of a loop
 10.3. Control Statements 10.5.2. for loop
 10.4. Selection statements 10.5.3. While loop
ur

10.4.1. if statement 10.5.4. do-while loop


10.4.2. if-else statement 10.5.5. Nesting of loops
10.4.3. Nested if
.s

 10.6. Jump statements


10.4.4. if-else-if ladder 10.6.1. goto statement
10.4.5. The ?: Alternative to if- 10.6.2. break statement
w

else 10.6.3. continue statement


w
w

[167]

orders@surabooks.com PH: 9600175757 / 8124201000 / 8124301000


This is only for Sample Materials
for Full Book order online and available at all Leading Bookstores
168 Sura’s  XI Std - Computer Science ➠ Volume II ➠ Unit III ➠ Chapter 10

Evaluation
Part - I 10. A loop that contains another loop inside its body:
(a) Nested loop (b) Inner loop
Choose the Correct Answer:
(c) Inline loop (d) Nesting of loop

m
1. What is the alternate name of null statement?  [Ans. (a) Nested loop]
(a) No statement (b) Empty statement Part - II
(c) Void statement (d) Zero statement Answers to All the questions : (2 Marks)

co
 [Ans. (b) Empty statement]
1. What is a null statement and compound
2. In C++, the group of statements should enclosed statement?
within:
Ans. (i) The "null or empty statment" is a statement
(a) { } (b) [ ]

s.
containing only a semicolon.
(c) ( ) (d) < > [Ans. (a) { }]
(ii) A group of statements enclosed by pair of
3. The set of statements that are executed again and braces {}. This group of statements is called as

ok
again in iteration is called as: a compound statement or a block.
(a) condition (b) loop 2. What is selection statement? write it's types?
(c) statement (d) body of loop Ans. The selection statement means the statement(s) are
 [Ans. (b) loop] executed depends upon a condition. If a condition
is true, a true block (a set of statements) is executed
4. The multi way branch statement:
o otherwise a false block is executed. This statement is
(a) if (b) if...else also called decision statement or selection statement
ab
(c) switch (d) for [Ans. (c) switch] because it helps in making decision about which set
of statements are to be executed.
5. How many types of iteration statements?
types are
(a) 2 (b) 3
(i) if statement
(c) 4 (d) 5 [Ans. (b) 3] (ii) if-else statement
ur

6. How many times the following loop will execute? (iii) rested if
for (int i=0; i<10; i++) (iv) switch-case.
(a) 0 (b) 10 3. Correct the following code segment:
.s

(c) 9 (d) 11 [Ans. (b) 10] if (x=1)


p=100;
7. Which of the following is the exit control loop?
else
(a) for (b) while
p=10;
w

(c) do...while (d) if...else


Ans. if (x==1)
 [Ans. (c) do...while] p=100;
8. Identify the odd one from the keywords of jump else
w

statements: p=10;
(a) break (b) switch 4. What will be the output of the following code:
(c) goto (d) continue int year;
w

 [Ans. (b) Switch] cin>>year;


9. Which of the following is the exit control loop? if(year % 100 = =0)
(a) do-while (b) for if(year % 400 = =0)
(c) while (d) if-else cout << "Leap";
else
 [Ans. (a) do-while] cout << "Not Leap year";
If the input given is (i) 2000 (ii) 2003 (iii) 2010?

orders@surabooks.com PH: 9600175757 / 8124201000 / 8124301000


This is only for Sample Materials
for Full Book order online and available at all Leading Bookstores
Sura’s  XI Std - Computer Science ➠ Flow of Control 169

Ans. (i) leap year Ans. int v = 5;


(ii) Not Leap year do
(iii) Not Leap year. {
total +=v;
5. What is the output of the following code? cout << total;
for (int i=2; i<=10; i+=2) v=v+1;

m
cout << i; }while (v<=10);
Ans. 2 4 6 8 10. 3. Write a C++ program to print multiplication
table of a given number.
6. Write a for loop that displays the number from

co
Ans. #include<iostream>
21 to 30.
using namespace std;
Ans. for (i=21; i<=30; i++)
int main()
cout << i;
{
7. Write a while loop that displays numbers 2, 4, 6,
int num;

s.
8........20
cout<<"Enter Number To Find Multiplication table ";
Ans. int i=2;
cin>>num;
while (i<=20)
for(int a=1;a<=10;a++)

ok
{
{
cout << i;
cout<<num<<" * "<<a<<" = "<<num*a<<endl;
if=2;
}
}
return 0;
8. Compare an if and a? : operator.
o }
4. Write the syntax and purpose of switch statement.
ab
Ans. if ?:
Ans. The switch statement is a multi-way branch statement.
Multiple statements are only one statement It provides an easy way to dispatch execution to
used used. It is an alternative different parts of code based on the value of the
Eg: if (p = = 10) statement for if_else. expression. The switch statement replaces multiple
p = 100; Eg: (p ==10)? p=100; if-else sequence.
ur

else p=10; The syntax of the switch statement is:


p =10; switch(expression)
{
Part - III case constant 1:
.s

Answer to All the questions :(3 Marks) statement(s);


break;
1. Convert the following if-else to a single conditional case constant 2:
statement:
w

statement(s);
if(x >=10) break;
a = m + 5; .
else .
w

a = m; .
.
Ans. a = (x > =10) ? m+5 :m; default:
statement(s);
2. Rewrite the following code so that it is functional:
w

}
v = 5;
do; 5. Write a short program to print following series:
{ (a) 1 4 7 10.....40
total += v; Ans. #include <iostream.h>
cout << total; using namespace std;
while v <= 10 int main()

orders@surabooks.com PH: 9600175757 / 8124201000 / 8124301000


This is only for Sample Materials
for Full Book order online and available at all Leading Bookstores
170 Sura’s  XI Std - Computer Science ➠ Volume II ➠ Unit III ➠ Chapter 10
{ evaluated before the entering into a loop.
for (int i=1; i<=40; i + =3) The while loop syntax is :
cout << i << endl; while ( Text expression )
} {
getch(); Body of the loop;

m
} }
Statement-x;
Part - IV The control flow and flow chart of the while loop is
shown below :

co
Answer to All the Questions: (5 Marks)
1. Explain control statement with suitable example.
Test
 [HF. 2018] expression
false

Ans. Control statements are statements that alter the

s.
sequence of flow of instructions. If the statements are
True
executed sequentially, the flow is called as sequential
Body of while
flow. In some situations, if the statements alter the Loop

ok
flow of execution like branching, iteration, jumping
and function calls, this flow is called as control flow.
Sequence statement: Statement-X;

Statement 1

Statement 2
o In while loop, the test expression is evaluated and if

Statement 3 the test expression result is true, then the body of the
ab
loop is executed and again the control is transferred
The sequential statement are the statements, that to the while loop. When the test expression result is
are executed one after another only once from top false the control is transferred to statement-x.
to bottom. These statement do not alter the flow of Example :
execution. These statement are called as sequential
ur

#include<iostream>
flow statements. They are always end with a
semicolon (;). using namespace std;
If - else : In if-else statement, first the expression int main ()
or condition is evaluated either true of false. If the {
.s

result is true, then the statements inside true-block int i=1, sum=0;
is executed and false-block is skipped. If the result while(i<=10)
is false, then the statement inside the false-block is {
w

executed i.e., the true-block is skipped. sum=sum+1;


if (rem==0) i++;
 cout<< "\n The given number" <<num<<" is
Even"; }
w

else cout<<"The sum of 1 to 10 is"<<sum;


cout<<"\n The given number"<<num<<" is Odd"; return 0;
}
2. What is an entry control loop? Explain any one of
w

Output : The sum of 1 to 10 is 55


the entry controlled loop with suitable example.
Ans. In loop, if the condition checked in the beginning of 3. Write a program to find the LCM and GDC of
execution of the loop is called entry control loop. two numbers.
 While loop : A while loop is a control flow statement Ans. program to find GDC and LCM
that allows the loop statements to be executed as #include<iostream.h>
long as the condition is true. The while loop is an using namespace std;
entry-controlled loop because the test-expression is

orders@surabooks.com PH: 9600175757 / 8124201000 / 8124301000


This is only for Sample Materials
for Full Book order online and available at all Leading Bookstores
Sura’s  XI Std - Computer Science ➠ Flow of Control 171

int main() }
{ cout <<"sum of series ="<<(s1-s2);
int n1,n2, a, b, gcd, lcm; return 0;
cout<<"Enter two numbers"<<endl; }
cin>>n1>>n2; (b) # program to find the same of the series

m
a=n1; #include<iostream.h>
b=n2; using namespace std;
while (n1 !=n2) int main ()
{

co
{ if (n1 > n2)
n1 = n1 - n2; int i, x, n, s=0;
else cout<<"Enter the value of x"<<endl;
n2 = n2 - n1; cin>>x;
cout<<"Enter number of terms"<<endl;
}

s.
cin>>n;
gcd = n1;
for (i=1; i<=n; i++)
cout << "GCD=" <<gcd;
s=s+(pow(x,i)/i);
lcm = (a * b) / gcd;

ok
cout<<"The sum="<<s;
cout <<"LCM =" << lcm;
} getch();
4. Write programs to find the sum of the following }
series: o 5. Write a program to find sum of the series:
22 33 44 55 66
xx xx xx xx xx S = 1 + x + x2 + .......+ xn
(a) x- ++ −− ++ −−
22! ! 33! ! 44! ! 55! ! 66! ! Ans. //program to find the sum of series
ab
xx2 2 xx3 3 xxn n #include<iostream.h>
(b) x + ++ ++..... +
..... + using namespace std;
22 33 nn
int main ()
Ans. (a) //To find the sum of the series {
#include<iostream>
ur

int x, n, i, s = 0;
using namespace std; cout<<"Enter the values of x"<<endl;
int main () cin>>x;
{ cout<<"Enter the number of terms"<<endl;
.s

int i, x, s1=0, s2=0, j; cin>>n;


cout<<"Enter the value of x"<<endl; for (i=0; i<=n; i++)
cin>>x; s = s+pow(x, i);
w

for (i=1; i<=5; i+=2) cout << "The sum="+s;


{ }
int f = 1;
Hands on Practice
w

for (j=1; j<=i; j++)


f=f*j; Write C++ program to solve the following problems :
s1 = sj+(Math.pow(x, i y f);
1. Temperature - conversion program that gives
w

}
the user the option of converting Fahrenheit to
for (i=2; i<=6; i+=2) Celsius or Celsius to Fahrenheit and depending
{ upon user's choice.
int f = 1;
Ans. #include<iostream>
for (j=1; j<=i; j++)
using namespace std;
f=f*j;
int main ( )
s2 = s2+(Math.pow(x, i y f);

orders@surabooks.com PH: 9600175757 / 8124201000 / 8124301000


This is only for Sample Materials
for Full Book order online and available at all Leading Bookstores
172 Sura’s  XI Std - Computer Science ➠ Volume II ➠ Unit III ➠ Chapter 10
{ cout<<num1*num2;
int a; break;
cout<<"1. For Celsius to Fahrenheit.\n"; case '/':
cout<<"2. For Fahrenheit To Celsius. \n"; cout<<num1/num2;
cout<<"3. For Exit\n\n"; break;
cout<<"Enter Your Choice\n"; default:

m
//if the operator is other than +, -,
switch(a)
* or/, error message is shown
{
 cout<<"Error! operator is not
double cel, feh;

co
correct"
 case 1: cout<<"Enter The Temperature in break;
 Celsiush\n"; cin>>cel; }
feh = (cel*9/5)+32; return 0;
cout<<"\nTemperature in Fahrenheit is = "<<feh; }

s.
break; Output:
 case 2: cout<<"Enter The Temperature in Enter operator either + or - or * or divide;-
 Fahrenheit\n|; cin>>feh Enter two operands:
3.4

ok
cel = (feh–32)*5/9;
cout<<"\nTemperature in Celsius is = "<<cel; 8.4
break; 3.4-8.4 = 5.0
case 3: exit (0); 3. Program to print whether a given character is an
default:cout<<"\nEnter The Right Choice\n"; uppercase or a lowercase character or a digit or
break;
o any other character. use ASCII codes for it. The
} ASCII codes are as given below:
ab
Characters ASCII Range
return 0;
} '0' - '9' 48 - 57
'A' - 'Z' 65 - 90
2. The program requires the user to enter two
'a' - 'z' 97 - 122
numbers and an operator. It then carries out
other characters  0- 255 excluding the
ur

the specified arithmetical operation: addition,


subtraction, multiplication or division of the two above mentioned codes.
numbers. Finally, it displays the result. Ans. #include<iostream>
Ans. #include<iostream> using namespace std;
.s

using namespace std; int main( )


int main ( ) {
{ char ch;
char op;
w

cout<< "Enter a character"<<endl;


float num1, num2; cin>>ch;
cout<<"Enter operator either + or - or * or/:"; if ((ch>=65 & & ch <=90)
cin>>op; cout << "Alphabet : upper case";
w

cout<<"Enter two operands:";


cin>>num1>>num2; else if ((ch>= 97 && ch <= 122))
switch(op) cout <<"Alphabet : Lowwer case";
{ else if (ch>= 48&& ch<=57)
w

case '+':
cout<<num1+num2; cout <<"Digt";
break; else
case '-': cout<<"Special Character";
count<<num1-num2; return 0;
break; }
case '*':

orders@surabooks.com PH: 9600175757 / 8124201000 / 8124301000


This is only for Sample Materials
for Full Book order online and available at all Leading Bookstores
Sura’s  XI Std - Computer Science ➠ Flow of Control 173

4. Program to input a character and to print whether int n, i;


a given character is an alphabet, digit or any other cout<<"Enter a number"<<end1;
character. cin>>n;
Ans. #include<iostream>
for (i=i;i<=n; i++)
using namespace std; {
int main ()

m
if(n%i== 0)
{ cout<<i<<"\t",
char ch; }
cout<<"Enter any character:"; return 0;

co
ch=getchar(); }
if (isalpha (ch))
cout<<"Alphabet"; 8. Program to print fibonacci series i.e., 0 1 1 2 3 5 8......
else if (isdigit(ch)) Ans. #include<iostream>
using namespace std;

s.
cout<<"Number";
int main ( )
else
{
cout<<"Special Character";
int n, i, a = θ, b = 1
return 0;

ok
cout<<"Enter number of terms"<<end1;
} cin>>n;
5. Program to calculate the factorial of an integer. cout<"Fibonacci series"<<end1;
Ans. #include<iostream> cout<<a<<"\t"<<b;
using namespace std; for(i=3;i<=n;; i ++)
int main ( )
o {
c=a+b;
{
ab
cout<<c<<"\t";
int n, i, f = 1;
a =b;
cout<<"Enter a number"<<end1; b=c;
cin>>n; }
for (i =1; i<=n; i++) return 0 ;
ur

f=f*i; }
cout<<"Factorial of a given number =" <<f<<end1;
9. Programs to produces the following design using
return 0; nested loops.
}
.s

(a) (b) (c)


6. Program that print 1 2 4 8 16 32 64 128.
Ans. #include<iostream> A 5 4 3 2 1 # # # # ###
#include<math.h> A B 5 4 3 2 # # # # #
w

A B C 5 4 3 # # #
using namespace std; A B C D
int main ( ) 5 4 #
A B C D E
{ A B C D E F 5
w

for (i=o; i<8; i ++) Ans. (a)


#include<isotream>
cout<<pow(2,i)<<"t". using namespace std;
return 0; int main ( )
w

} {
7. Program to generate divisors of an interger. for(int i = 1; i < = 5; i++)
{
Ans. #include<iostream>
for(int j =5; j>=i; j--)
using namespace std;
{
int main ( ) cout<<j"\t";
{ }

orders@surabooks.com PH: 9600175757 / 8124201000 / 8124301000


This is only for Sample Materials
for Full Book order online and available at all Leading Bookstores
174 Sura’s  XI Std - Computer Science ➠ Volume II ➠ Unit III ➠ Chapter 10
cout<<'n'; }
} while)k ! = 2*i - 1)
return 0 ; {
{ cout <<"*";
}
(b) #include<iostream>
Cout<<end1;

m
using namespace std;
}
int main ( )
{ 10. Program to check whether the square root of a
int n = 65, rows; number is prime or not..

co
 cout<<"Enter number of rows: "; Ans. #include<iostream>
cin>>rows; #include<math.h>
for (int i = 65; i<=(65+rows-1); i++) using namespace std;
{ int main ( )
for(int j = 65; j<=i; j++)

s.
{
{ int n, i, m,c ;
cout<<(char)j>>"\t"; cout<<"Enter a number"<<end1;
} cin>>n;

ok
return 0; m=sqrt(n);
} for (i=1;1<m; i++)
(c) #include<iostream> {
using namespace std; if(m%i== θ)
c++;
int main ( )
{
o }
int space, rows; if(c==2)
ab
cout<<"Enter number of rows:";  cout<<"The square root of a given number is
cin>> rows; prime"<<end1;
for (int i = rows, k =θ ; i > = 1; k = θ) else
{ cout<<"The square root of a given number is not
prime"<<end1;
ur

for (space = rows -i; space >=1; -- space)


{ }
cout<<" " ;

additional questions and Answers


.s

PART - I 3. Which of the following statement commonly used


as place holders in iteration statements?
w

Choose the Correct Answers 1 MARK (a) loop


I. Choose the Correct options for the (b) Assignment
w

below Questions. (c) Empty


(d) switch [Ans. (c) Empty]
1. How many kinds of statement used in C++?
4. Which of the following statement used to palce
(a) 3 (b) 2
w

lables at the end of compound statements?


(c) 6 (d) only 1 [Ans. (b) 2]
(a) if
2. Which of the following statement containing only (b) else-if
a semicolon?
(c) null
(a) Loop (b) Selection (d) empty
(c) Assignment (d) Null [Ans. (d) Null] (e) c or d [Ans. (e) c or d]

orders@surabooks.com PH: 9600175757 / 8124201000 / 8124301000


This is only for Sample Materials
for Full Book order online and available at all Leading Bookstores
Sura’s  XI Std - Computer Science ➠ Flow of Control 175

5. Which of the following used to enclose a group of 13. In C++, which of the following is treated as true?
statements? (a) non zero (b) negative numbers
(a) { } (b) ( ) (c) zero (d) both a and b
(c) [ ] (d) < > [Ans. (a) { }]  [Ans. (d) both a and b]
6. Which statement used to change the flow of 14. Which of the following causes a one time jump to

m
control? a different part of the program?
(a) Control (b) Selective (i) decision (ii) selection (iii) iteration
(c) Compound (d) Alternative (a) only (i) (b) only (ii)

co
 [Ans. (a) Control] (c) both (i) and (ii) (d) only (iii)
7. Which of the statement(s) called as control flow?  [Ans. (c) both (i) and (ii)]
(a) branching (b) iteration 15. Which of the following statement executes the
(c) jumping (d) function calls block between two alternatives?

s.
(e) all of these [Ans. (e) all of these] (a) logical if (b) if-else
(c) nested if (d) for [Ans. (b) if-else]
8. Which of the following statements do not after the
flow of execution? 16. Which statement creates branches for multiple

ok
(a) iteration (b) jumping alternatives sections of code depending on single
variable value?
(c) sequential (d) function calls
(a) if (b) if-else
 [Ans. (c) sequential]
(c) switch-case (d) do-while
9. Which of the statements executed one after
 [Ans. (c) switch-case]
another only one?
o 17. Which of the following is a multi-path decision
(a) iteration (b) sequential
making statement?
ab
(c) jumping (d) functional calls
 [Ans. (b) sequential] (a) nested if (b) if-else -if ladder
(c) if-else (d) nested else
10. Which of the following statement are executed  [Ans. (b) if-else -if ladder]
depends upon a condition?
ur

(a) Empty (b) Selection 18. Which of the following statement executed if none
of the conditions is true in if-else-if ladder?
(c) Null (d) Compound
(a) if (b) both if and else
 [Ans. (b) Selection] (c) else (d) condition
.s

11. Which of the following statement also called  [Ans. (c) else]
looping statement? 19. Which of the following is an alternative for 'if else
(a) branching (b) decision statement'?
w

(c) repetition (d) iterative (a) Relational operator (b) Logical operator
 [Ans. (d) iterative] (c) Unary operator (d) Conditional operator
 [Ans. (d) Conditional operator]
12. Which of the following expression evaluates true
w

or false? 20. How many symbols are there in conditional


operator?
(a) Orithmetic expression
(a) 3 (b) 4
w

(b) Unary expression (c) 2 (d) many [Ans. (c) 2]


(c) Relational expression 21. How many arguments the conditional operator
(d) Ossignment Arithmetic expression takes?
 [Ans. (c) relational expression] (a) 2 (b) 4
(c) 6 (d) 3 [Ans. (d) 3]

orders@surabooks.com PH: 9600175757 / 8124201000 / 8124301000


This is only for Sample Materials
for Full Book order online and available at all Leading Bookstores
176 Sura’s  XI Std - Computer Science ➠ Volume II ➠ Unit III ➠ Chapter 10
22. Which of the following statement replaces 31. Which of the following statement evaluates only
multiple if-else sequence? character or a integer data type?
(a) if-else-if ladder (b) if-else . (a) if-else (b) for
(c) while (d) switch
(c) nested if (d) switch
 [Ans. (d) switch]
 [Ans. (d) switch]
32. In switch statement, the character constants are

m
23. Which of the following statement is optional in converted automatically into
switch? (a) ASCII (b) BCD
(i) case (ii) break (iii) default (c) EBCDIC (d) ISCII
 [Ans. (a) ASCII]

co
(a) only (i) (b) only (ii)
(c) both (i) and (iii) (d) both (ii) and (iii) 33. How many types of iteration statements are there
 [Ans. (d) both (ii) and (iii)] in C++?
24. Which of the following statement is more flexible (a) 2 (b) 3
than switch statement?

s.
(c) 4 (d) 5 [Ans. (a) 2]
(a) for (b) if
34. What is the output of the following program
(c) while (d) break [Ans. (b) if] snippet if a=11?

ok
25. Which of the following is a selection statement? int a;
(a) for (b) while switch (a)
(c) do-while (d) none of these {
 [Ans. (d) none of these] case 0;
cout <<"The number is zero"<<break;
o
26. Which of the following is a selection statement? default;
(i) if-else (ii) switch cout <<"The number is nonzero"<<break;
ab
int b = a% 2;
(iii) for
swith (b)
(a) only (i) (b) only (ii) {
(c) both (i) and (ii) (d) only (iii) case 0;
 [Ans. (c) both (i) and (ii)] cout<<"The number is even"<<break;
case 1;
ur

27. Which of the following decide whether to cout<<"The number is odd"<<break;


execute the statements inside if block and switch }
statement? (i) The number is zero
(a) variable (b) constant (ii) The number is non zero
.s

(c) operator (d) expression (iii) The number is even


 [Ans. (d) expression] (iv) The number is odd
28. Which of the following statement uses single (a) both (i) and (iv) (b) both (ii) and (iii)
w

expression for multiple choices? (c) both (ii) and (i) (d) both (ii) and (iv)
(a) if-else (b) switch  [Ans. (d) both (ii) and (iv)]
(c) for (d) case[Ans. (b) switch]
w

35. How many elements are there in every loop?


29. Which of the following statement checks for (a) 3 (b) 5
equality as well as for logical expression?
(c) 4 (d) 2 [Ans. (c) 4]
(a) for (b) continue
w

(c) if-else (d) switch 36. Which of the following is not an iteration
 [Ans. (c) if-else] statement in C++?
30. Which of the following statement checks only for (a) for (b) switch
equality? (c) while (d) none of these
(a) for (b) switch  [Ans. (b) switch]
(c) if-else (d) default
 [Ans. (b) switch]

orders@surabooks.com PH: 9600175757 / 8124201000 / 8124301000


This is only for Sample Materials
for Full Book order online and available at all Leading Bookstores
Sura’s  XI Std - Computer Science ➠ Flow of Control 177

37. Which of the following is the easiest looping i++;


statement? }
(a) for (b) while (a) i=4 (b) i=5
(c) do-while (d) all of these (c) i=6 (d) s=10 [Ans. (b) i=5]
 [Ans. (a) for] 46. Which of the following loop is an exit-check loop?

m
38. How many different statements the for loop (i) for loop (ii) while looop (iii) do-while loop
contains? a. only (i) b.only (ii)
(a) 2 (b) 3 c. only (iii) d. both (i) and (iii)

co
(c) 4 (d) 6 [Ans. (b) 3]  [Ans. (c) only (iii)]
39. For loop elements are terminated by
47. Which of the following statement are used to
(a) : (b) ; interrupt the normal flow of program?
(c) , (d) ? [Ans. (b) ;]
(a) selection (b) jump

s.
40. How many times the following loop executes? for (c) branching (d) loop[Ans. (b) jump]
(i=0; i>5; i++)
48. How many types of jump statements are there in
{=
C++?

ok
}
(a) 4 (b) 3
(a) 4 (b) 5
(c) 2 (d) 5 [Ans. (b) 3]
(c) 0 (d) infinite
 [Ans. (d) infinite] 49. Which of the following is not a jump statement in
41. Which of the following increase the flexibility and C++?
applicability of for loop?
o (a) goto (b) break
(a) initilization (b) text expression (c) continue (d) if-else
ab
(c) updation (d) variations  [Ans. (d) if-else]
 [Ans. (d) variations]
50. Which of the following statement used to transfer
42. Which will be the output of the following? the control from one part to another part without
for (i=0, j=0; i == 0, j ==0; i++, --j) any condition?
ur

cout << i << j; (a) if (b) if-else


(a) 0.0 (b) 1 -1 (c) goto (d) if else-if
(c) 0 -1 (d) -1 -1 [Ans. (c) 0 -1]  [Ans. (c) goto]
.s

43. Which of the following statement executes faster?


(i) ++a (ii) a++ II. Match List I with List II and Select
(a) only (i) (b) only (ii) the Correct Answer using the Codes given
w

(c) both (i) and (ii) (d) none of these below.


 [Ans. (b) only (ii)]
44. Which of the following loop is an entry-controlled 1.
List I List II
loop?
w

(i) Initialization 1 loop variable


(i) for loop (ii) while looop (iii) do-while loop
changes the value
(a) only (i) (b) only (ii)
(ii) Test 2 Executed repeatedly
w

(c) both (i) and (ii) (d) only (iii)


 [Ans. (c) both (i) and (ii)] expression

45. When the following loop terminates the execution?


(iii) Update 3 Executed only once
expression in the beginning of
int i =1;
the loop
while (i<5)
{ (iv) Body of the 4 the loop terminates
s =s +i; loop if it is false

orders@surabooks.com PH: 9600175757 / 8124201000 / 8124301000


This is only for Sample Materials
for Full Book order online and available at all Leading Bookstores
178 Sura’s  XI Std - Computer Science ➠ Volume II ➠ Unit III ➠ Chapter 10
Codes: 8. Both selection and iterative statements are
(i) (ii) (iii) (iv) executed depends upon the
(a) 4 1 3 2 (a) Conditional expression
(b) 1 3 2 4 (b) Arithmetic expression
(c) 4 3 1 2 (c) Assignment expression

m
(d) 3 4 1 2 (d) block [Ans. (a) Conditional expression]
 [Ans. (d) (i)-3, (ii)-4, (iii)-1, (iv)-2]
9. The expression provided in the switch should
result in a....................
III. Choose the Correct Option Fill

co
and in (a) operator (b) punctuator
the Blanks. (c) variable (d) constant
 [Ans. (d) constant]
1. A group of statements enclosed by {} is called
(a) body statement (b) iterative statement 10. On which condition the execution of the loop
terminates

s.
(c) compound statement (d) continue statement
 [Ans. (c) compound statement] (a) if (b) else
(c) stop (d) test
2. The null or empty statement is a statement

ok
 [Ans. (d) test]
containing only a
(a) semicolon (;) (b) colon (:) 11. In a if statement , condition is enclosed with
(c) comma; (d) bracess {} (a) ( ) (b) { }
 [Ans. (a) semicolon (;)] (c) [ ] (d) < > [Ans. (a) ( )]
12. In for loop, multiple elements are seperated by
3. A compound statement is also called
o (a) ; (b) ,
(a) iterative statement (b) block statement (c) : (d) :? [Ans. (a) ;]
ab
(c) alternative statement (d) infinite statement
 [Ans. (b) block statement] 13. Which of the following expression is optional in
for loop
4. Programming languages provides statements to (i) initialization (ii) test expression (iii) update
support (a) both (i) and (ii) (b) both (ii) and (iii)
ur

(a) sequence (b) selection


(c) both (i) (ii) and (iii) (c) both (i) and (iii)
(c) iteration (d) all of these
 [Ans. (c) both (i) (ii) and (iii)]
 [Ans. (d) all of these]
14. for (i=0; i<=5; i+=2); is called
.s

5. The sequential statement always end with


(a) finite loop (b) logical loop
(a) ; (b) :
(c) empty loop (d) simple loop
(c) // (d) # [Ans. (a) ;]  [Ans. (c) empty loop]
w

6. Selection statement is also called 15. if no statement in the body loop is called
(a) empty (b) compound (a) empty loop (b) finite loop
(c) continue (d) decision (c) simple loop (d) selection loop
w

 [Ans. (d) decision]  [Ans. (a) empty loop]


7. The ________ statement is a control statement, 16. In do-while loop, the condition is evaluated at the
which is used to transfer the control from one (a) bottom (b) top
w

place to another place without any condition in a (c) middle (d) right
program.  [HF. 2018]  [Ans. (a) bottom]
(a) Break (b) go to
(c) continue (d) Switch 17. Conditional operator is also called ................
(a) Ternary operator (b) Relational operator
 [Ans. (b) go to]
(c) Logical operator (d) Unary operator
 [Ans. (a) Ternary operator]

orders@surabooks.com PH: 9600175757 / 8124201000 / 8124301000


This is only for Sample Materials
for Full Book order online and available at all Leading Bookstores
Sura’s  XI Std - Computer Science ➠ Flow of Control 179

IV. Which one of the Following is Not (a) only (i) (b) only (ii)
Correctly Matched? (c) both (i) and (iv) (d) only (iii)
 [Ans. (d) only (iii)]
1. Which one of the following is not correctly 3. (i) The if else ladder is a multi-path decision
matched? making statement.

m
(a) Null statement - Semicolon (ii) The switch statement is a multi-way branch
(b) Compound - Pair of braces statement.
statement (iii) When a switch is a part of the statement
sequence of another switch, then it is called

co
(c) Iteration - Looping statement
as nested switch statement.
statement
(a) (i) is correct
(d) If statement - Body of the loop (b) (ii) is correct
 [Ans. (d) If statement - Body of the loop] (c) (i) and (iii) are correct

s.
(d) (i), (ii) and (iii) are correct
V. Consider the Following Statement. [Ans. (d) (i), (ii) and (iii) are correct]
4. Which of the following statement exist in a true

ok
1. Assertion (A) :  A computer program is a set
block of if-statement?
of statements or instructions to
(i) Single statement
perform a specific task.
(ii) Compound statement
Reason (R) :  The action may be of variable
(iii) Empty statement
declarations, expression
o
evaluations, assignment operations,
(a) only (i) (b) only (ii)
(c) only (iii) (d) all of these
decision making looping and so on.
ab
 [Ans. (d) all of these]
(a) Both (A) and (R) are true and (R) is the correct
explanation of (A). 5. Which of the following statement is true?
(b) Both (A) and (R) are true and (R) is not the (i) continue statement skips the iteration
correct explanation of (A). (ii) Break statement is used only in loops
ur

(c) (A) is true, but (R) is false. (iii) Break statement is not used to terminate the
(d) (A) is false, but (R) is true. execution of loop
[Ans. (a) Both (A) and (R) are true and (R) is the (iv) continue statement used in loops and switch
correct explanation of (A)] case.
.s

(a) only (i) (b) only (iv)


(c) both (i) and (iii) (d) both (iii) and (iv)
VI. Choose the Correct Statement.
 [Ans. (b) only (iv)]
w

1. Which of the following statement is true? 6. Which of the following statement is true?
(i) Break statement in switch is not optional (i) ; is a null statement
(ii) Duplicate case values are allowed (ii) Empty statement are used as placeholders is loop
w

(iii) The default statement is not optional statements


(iv) Nesting of switch statement is allowed (a) only (i) (b) only (ii)
(a) only (iv) (b) only (iii) (c) both are true (d) both are wrong
w

(c) both (i) and (ii) (d) both (iii) and (iv)  [Ans. (c) both are true]
 [Ans. (d) both (iii) and (iv)] 7. Which of the following statement is true?
2. Which of the following statement is not true? (a) expression 1? expression 2 : expression 3 ;
(i) If nested inside if part (b) expression 1: expression 2 ? expression 3 ;
(ii) If nested inside else part (c) expression 1; expression 2 : expression 3 ?
(iii) for nested inside if part (d) expression 1? expression 2 ; expression 3 ?
(iv) if nested inside both if part and else part [Ans. (a) expression 1? expression 2 : expression 3 ;]

orders@surabooks.com PH: 9600175757 / 8124201000 / 8124301000


This is only for Sample Materials
for Full Book order online and available at all Leading Bookstores
180 Sura’s  XI Std - Computer Science ➠ Volume II ➠ Unit III ➠ Chapter 10
8. Which of the following statement is true regarding 4. Write a While loop that displays numbers 3,6,9,12
loop? .....30.  [HF. 2018]
(i) reduce the length of code Ans. #include <iostream>
(ii) reduce time using namespace std;
(iii) takes less memory space int main ( )
(a) both (i) (b) only (ii) { int i=3;

m
(c) both (i) and (iii) (d) all of these while (i<=30)
 [Ans. (d) all of these] {
Cout<<’\n’<<i;

co
VII. Point out the Wrong Statement in the i+3;
following. }
1. Which of the following statement is false? }
(i) switch statement is a multi-way branch statement 5. Write the general format of compound statement

s.
in C++.
(ii) if-else-if ladder is a multi-path decision making
Ans. The general format of compound statement is :
statement
{

ok
(iii) null statement consist only : statement 1;
(iv) In swith-case, the default statement is compulsory statement 2;
(a) Both (i) and (ii) (b) Only (iii) and (iv) statement 3;
(c) Both (i) and (iii) (d) Both (ii) and (iv)
o }
 [Ans. (b) Both (iii) and (iv)]
6. How the statement are executed in a C++
2. Which of the following statement is false? program?
ab
(i) Conditional operator also called Ternary operator Ans. In a program, statements may be executed
(ii) Conditional operator is an alternative for if-else- sequentially, selectively or interatively.
if ladder 7. What is body of the loop?
(iii) Ternary operator takes four arguments Ans. The set of statements that are executed again and
ur

(iv) The symbols used in ternary operator is? : again is called the body of the loop.
(a) only (i) (b) only (ii) 8. Write the syntax of if statement.
(c) both (ii) and (iii) (d) both (ii) and (iv) Ans. if (expression)
 [Ans. (c) both (ii) and (iii)] true-block;
.s

statement-x;
PART - II 9. What is if statement is executed?
Very Short Answers Ans. The if statement evaluates a condition, if the
w

2 MARKS
condition is true then a true-block (a statement or set
1. Define control flow. of statements) is executed, otherwise the true-block
Ans. The flow of control jumps from one part of the code is skipped.
w

to another segment of code. Program statements that


cause such jumps are called as "Control flow" 10. Define iteration.
Ans. An iteration (or looping) is a sequence of one or
2. Write the basic control structures. more statements that are repeatedly executed until a
w

Ans. The basics of control structures such as "Selection", condition is satified. These statements are also called
"Iteration" and "Jump" statement. as control flow statements.
3. Write the two kinds of statements used in C++ 11. What is the use of iteration statements?
Ans. There are two kinds of statements used in C++ Ans. Iteration statements is used to reduce the length of
(i) Null statement code, to reduce time, to execute program and takes
(ii) Compound statement. less memory space.

orders@surabooks.com PH: 9600175757 / 8124201000 / 8124301000


This is only for Sample Materials
for Full Book order online and available at all Leading Bookstores
Sura’s  XI Std - Computer Science ➠ Flow of Control 181

12. Write the three types of iteration? 19. Why do you prefer prefix operator over postfix
Ans. for statement while updating expression in a loop?
(i) while statement (ii) do-while statement Ans. The update expression contains increment/decrement
operator (++ or --). In this part, always prefer prefix
13. Name the elements used in loop
increment/decrement operator over postfix when to
Ans. (i) Initialization expression
be used alone. The reason behind this is that when

m
(ii) Test expression
used alone, prefix operators are executed faster than
(iii) Update expression
postfix.
(iv) The body of the loop
20. Write a program to find sum of first 10 natural

co
14. Write the general syntax of for loop
numbers.
Ans. The general syntax is:
Ans. #include<iostream>
for (initialization(s); test-expression; update
expression(s)) using namespace std;
{ int main ()

s.
statement 1; {
statement 2; int i, sum=0, n;
------------- cout<<"\n Enter The value of n";
}

ok
cin>>n;
Statement-x; i = 1;
15. Write a short note on iteration statement. for ( ; i<=10;i++)
Ans. The iteration statement is a set of statement are }
repetitively executed depends upon a conditions. If sum +=i;
o
a condition evaluates to true, the set of statements }
(true block) is executed again and again. As soon cout<<"\n The sum of 1 to"<<n<<"is<<sum;
ab
as the condition becomes false, the repetition stops. return 0;
This is also known as looping statement or iteration }
statement. Output
Enter the value of n 5
16. What are the three forms of nested if.
The sum of 1 to 5 is 15
ur

Ans. An if statement contains another if statement is called


nested if. The nested can have one of the following 21. Write the syntax of while loop.
three forms. Ans. while ( Tese expression)
1. If nested inside if part {
.s

2. If nested inside else part Body of the loop;


3. If nested inside both if part and else part. }
17. Explain conditional operator. Statement-x;
w

Ans. The conditional operator (or Ternary operator) is an


alternative for 'if else statement'. The conditional
operator that consists of two symbols (?:). It takes 22. Write the syntax of do-while loop.
three arguments. The control flow of conditional Ans. do
w

operator is shown below {


The syntax of the conditional operator is: Body of the loop;
expression 1? expression 2 : expression 3
} while(condition);
w

18. Convert the following if-else in to conditional


operator. 23. Write a program to display number from 10 to 1
if (a > b) using do-while loop.
l = a; Ans. #include<iostream>
else using namespace std;
l = b; int main ()
Ans. l = (a > b) ? a : b;

orders@surabooks.com PH: 9600175757 / 8124201000 / 8124301000


This is only for Sample Materials
for Full Book order online and available at all Leading Bookstores
182 Sura’s  XI Std - Computer Science ➠ Volume II ➠ Unit III ➠ Chapter 10
{ cout<<"The sum of 1 to 10 is"<<sum;
int n =10; return 0;
do }
{ Output
cout<<n<<", "; The sum of 1 to 10 is 55
n– –;

m
2. What do you know about switch statement?
}while (n>0);
Ans. There are some important things to know about
}
switch statement. They are
Output

co
(1) A switch statement can only work for quality of
10, 9, 8, 7, 6, 5, 4, 3, 2, 1
comparisons.
24. What is the use of Jump statement? (2) No two case labels in the same switch can have
Ans. Jump statement are used to interrupt the normal flow identical values
of program.

s.
(3) If character constants are used in the switch
25. Write the types of jump statements in C++ statement, they are automatically converted to
Ans. (i) goto statement (ii) break statement their equivalent ASCII codes..

ok
(iii) continue statement (4) The switch statement is more efficient choice
26. What is the significance of using break statement than if in a situation that supports the nature of
in C++? the switch operation.
Ans. A break statement is a jump statement which
o 3. Write a C++ program to find sum of any 5
terminates the execution of loop and the control is numbers.
transferred to resume normal execution after the Ans. #include<iostream>
body of the loop
ab
using namespace std;
27. What is the significance of using continue int main ()
statement in C++? {
Ans. The continue statement works quite similar to the int i=1,num,avg,sum=0;
break statement. Instead of terminating the loop while(i<=5)
ur

(break statement), continue statement forces the loop {


to continue or execute the next iteration. When the cout<<"Enter the number :";
continue statement is executed in the loop, the code cin>>num;
.s

inside the loop following the continue statement will sum=sum+num;


be skipped and next iteration of the loop will being. i++;
}
PART - III avg=sum/5;
w

Very Short Answers 3 MARKS cout<<"The sum is" <<sum<<endl;


1. Write C++ program to sum the numbers from 1 return 0;
}
w

to 10 using for loop.


Ans. #include<iostream> Output
using namespace std; Enter the number : 1
Enter the number : 2
w

int main ()
{ Enter the number : 3
int i, sum=0; Enter the number : 4
for(i=1; i<=10; i++) Enter the number : 5
{ The sum is 15
sum=sum + i;
}

orders@surabooks.com PH: 9600175757 / 8124201000 / 8124301000


This is only for Sample Materials
for Full Book order online and available at all Leading Bookstores
Sura’s  XI Std - Computer Science ➠ Flow of Control 183

4. What is goto statement? Explain. else


Ans. The goto statement is a control statement which is {
used to transfer the control from one place to another Flase_Part_Statements;
place without any condition in a program. }
}
else
The syntax of the goto statement is;

m
{
Syntax 1 Syntax 2 if(expression)
{
goto label; label; True_Part_Statements;

co
-------------------------- -------------------------- }
-------------------------- -------------------------- else
-------------------------- -------------------------- {
label; goto label; False_Part_Statements;

s.
}
5. Differentiate break and continue statement
}
Ans. Difference between Break and Continue
2. Draw the flowchart that shows the working

ok
Break Continue procedure of.
Break is used to Continue is not used to (i) if nested inside if part
terminate the execution terminate the execution (ii) if nested inside else part
of the loop. of loop. o (iii) if nested inside both if part and else part
It breaks the iteration It skips the iteration Ans. (i)
When this statements When this statement False Condition 1 True
ab
is executed, control is executed, it will not
will come out from the come out of the loop False
True
Condition 2
loop and executes the but moves/jumps to the
statement immediate next iteration of loop. Statement 3 Statement 2 Statement 1

after loop.
ur

Break is used with Continue is only used


loops as well as switch in loops, it is not used
case. in switch case. Statement x

PART - IV
.s

Nest Statement

1 if nested inside if Part

Long Answers 5 MARKS (ii)


w

False Condition True

1. Write the syntax of if nested inside both if part


and else part
w

Condition
Ans. The syntax of if nested inside both if part and else
part Statement Statement Statement

if(expression)
w

{
if(expression)
{ Statement

True_Part_Statements; Nest Statement


} 2 if nested inside else Part

orders@surabooks.com PH: 9600175757 / 8124201000 / 8124301000


This is only for Sample Materials
for Full Book order online and available at all Leading Bookstores
184 Sura’s  XI Std - Computer Science ➠ Volume II ➠ Unit III ➠ Chapter 10
(iii) False
Condition
True
Example :
False True False True
#include <iostream>
Condition Condition
using namespace std;
Statement Statement Statement Statement

3 if nested inside both if Part and else part int main()


3. Write the rules following while using switch-case {

m
in C++. int num;
Ans. Rules : cout << "\n Enter week day number:";
(i) The expression provided in the switch should cin >> num;
switch (num)

co
result in a constant value otherwise it would not
be valid. {
(ii) Duplicate case values are not allowed. case1 : cout<<"\n Sunday";break;
(iii) The default statement is optional. case2 : cout<<"\n Monday";break;
(iv) The break statement is used inside the switch to case3 : cout<<"\n Tuesday";break;

s.
terminate a statement sequence. When a break case4 : cout<<"\n Wednesday";break;
statement is reached, the switch terminates, case5 : cout<<"\n Thursday";break;
and the flow of control jumps to the next line case6 : cout<<"\n Friday";break;

ok
following the switch statement. case7 : cout<<"\n Saturday";break;
(v) The break statement is optional, If omitted, default : cout<<"\n Wrong input.....";
execution will continue on into the next
}
case. The flow of control will fall through to
subsequent cases until a break is reached. }
(vi) Nesting of switch statements is also allowed.
o Output:
Enter week day number: 6
4. Explain switch-case with an example.
ab
Friday
Ans. The switch statement is a multi-way branch statement.
5. What are the difference between if-else and
It provides an easy way to dispatch execution to
switch.
different parts of code based on the value of the
expression. The switch statement replaces multiple Ans. (i) Expression inside if statement decide whether to
ur

if-else sequence. execute the statements inside if block or under


The syntax of the switch statement is: else block. On the other hand, expression inside
switch statement decide which case to execute.
switch(expression) (ii) An if-else statement uses multiple statements
.s

{ for multiple choices. On other hand, switch


case constant 1: statement uses single expression for multiple
statement(s); choices.
w

break; (iii) If-else statement checks for equality as well


as for logical expression. On the other hand,
case constant 2:
switch checks only for equality.
statement(s);
w

(iii) The if statement evaluates integer, charter,


break;
pointer or floating-point type or Boolean type.
.
On the other hand, switch statement evaluates
. only character or integer data type.
w

. (iv) Sequence of execution is like statement under


. if block will execute or statements under else
default: block statement will execute. On the other hand
statement(s); the expression in switch statement decide which
} case to execute and if do not apply a break
statement after each case it will execute till the
end of switch statement.

orders@surabooks.com PH: 9600175757 / 8124201000 / 8124301000


This is only for Sample Materials
for Full Book order online and available at all Leading Bookstores
Sura’s  XI Std - Computer Science ➠ Flow of Control 185

(v) If expression inside if turn out to be false, cout<"The Number is: zero"<<endl;
statement inside else block will be executed. If break;
expression inside switch statement turn out to default:
be false then default statements are executed. cout<"The Number is a non-zero integer"<<endl;
(vi) It is difficult to edit if-else statements as it is int b = a % 2;
tedious to trace where the correction is required. switch (b)

m
On the other hand, it is easy to edit switch {
statements as they are easy to trace.
case 0:
6. Explain Nested switch with an example. cout<<"The Number is even"<<endl;

co
Ans. When a switch is a part of the statement sequence break;
of another switch, then it is called as nested switch case 1:
statement. The inner switch and the outer switch cout<"The number is odd"<<endl;
contant may or may not be the same. break;

s.
The syntax of the nested switch statement is: }
switch (expression) }
{ 7. Explain For loop with an example.
case constant 1:

ok
Ans. For loop : The for loop is the easiest looping
statement(s);
statement which allows code to be executed
break;
repeatedly. It contains three different statements
switch(expression) (initialization, condition or test-expression and
{ update expression(s) separated by semicolons.
case constant 1:
o The general syntax is
statement(s); for (initialization(s); test-expression; update
ab
break; expression(s))
case constant 2: {
statement(s); Statement 1;
break; Statement 2;
ur

. ................
. }
. Statement-x;
default :
.s

statement(s); The initialization part is used to initialize variables


} or declare variable which are executed only once,
case constant 2: then the control passes to test-expression. After
w

statement(s); evaluation of test-expression, if the result is false,


break; the control transferred to statement-x. If the result is
. true, the body of the for loop is executed, next the
control is transferred to update expression. After
w

.
. evaluation of update expression part, the control is
default : transferred to the test-expression part.
Example :
w

statement(s);
} #include <iostream>
Example: using namespace std;
switch (a) int main ()
{ {
case 0: int i;
for(i = 0; i< 10; i ++ )

orders@surabooks.com PH: 9600175757 / 8124201000 / 8124301000


This is only for Sample Materials
for Full Book order online and available at all Leading Bookstores
186 Sura’s  XI Std - Computer Science ➠ Volume II ➠ Unit III ➠ Chapter 10
cout<< "value of i : " <<i<<endl; {
return 0; statement(s);
} }while(condition);
Output : } while( condition );
value of i : 0 9. What are the part of a loop? Binary explain.
value of i : 1

m
Ans. Every loop has four elements that are used for
value of i : 2
different purpose. These elements are
value of i : 3
(i) Initialization expression
value of i : 4

co
(ii) Test expression
value of i : 5
(iii) Update expression
value of i : 6
(iv) The body of the loop
value of i : 7
value of i : 8 (ii) Initialization expression(s): The control
variable(s) must be initialized before the control

s.
value of i : 9
enters into loop. The initialization of the control
8. Write the syntax of Nested loop using. variable takes place under the initialization
(i) for (ii) while (iii) do-while expressions. The initialization expression is

ok
Ans. (i) for : executed only once in the beginning of the loop.
for (initialization(s); test-expression; update (ii) Test Expression: The test expression is an
expression(s)) expression or condition whose value decides
{ o whether the loop-body will be execute or not.
 for (initialization(s); test-expression; If the expression evaluates to true(i.e.,1), the
update expression(s) body of the loop executed, otherwise the loop
is terminated. In an entry-controlled loop, the
ab
{
test-expression is evaluated before the entering
statement(s);
into a loop whereas in an exit-controlled loop,
}
the test-expression is evaluated before exit from
statement(s); the loop.
}
ur

(iii) Update expression: It is used to change the


(ii) while : while(condition) value of the loop variable. This statement is
{ executed at the end of the loop after the body of
while(condition) the loop is executed.
.s

{ (iv) The body of the loop: A statement or set of


statement(s); statements forms a body of the loop that are
} executed repetitively. In an entry-controlled
w

statement(s); loop, first the test-expression is evaluated and


} if it is nonzero, the body of the loop is executed
(iii) do while : otherwise the loop is terminated. In an exit
controlled loop, the body of the loop is executed
w

do
first then the test-expression is evaluated. If the
{
test-expression is true the body of the loop is
statement(s); repeated otherwise loop is terminated.
w

do



orders@surabooks.com PH: 9600175757 / 8124201000 / 8124301000


This is only for Sample Materials
for Full Book order online and available at all Leading Bookstores

UNIT- III INTRODUCTION TO C++

11

m
Chapter Functions

co
CHAPTER SNAPSHOT

s.
 11.1. Introduction 11.6.3. Inline function
 11.2. Need for Functions  11.7. Different forms of User-

ok
 11.3. Types of Functions defined Function declarations
 11.4. C++ Header Files and Built-in 11.7.1. A Function without return
Functions value and without parameter
11.4.1. Standard input/ 11.7.2. A function with return value
output(stdio.h)
o and without parameter
11.7.3. A Function without return
ab
11.4.2. Character functions(ctype.h)
11.4.3. String manipulation(string.h) value and with parameter

11.4.4. Mathematical functions 11.7.4. A function with return value


(math.h) and with parameter
ur

11.4.5. Generating Random Numbers  11.8. Returning from function

 11.5. User-defined Functions 11.8.1. The return statement

11.5.1. Introduction 11.8.2. The returning values


.s

11.5.2. Function Definition 11.8.3. The Returning by reference


 11.9. Recursive Function
11.5.3. Function Prototype
w

 11.10. Scope Rules of Variables


11.5.4. Use of void command
11.10.1. Introduction
11.5.5. Accessing a function
11.10.2. Local Scope
w

 11.6. Methods of calling functions


11.10.3. Function Scope
11.6.1. Call by Value Method
11.10.4. File Scope
11.6.2. Call by reference or address
w

11.10.5. Class Scope


Method
11.10.6. Scope resolution Operator

[187]

orders@surabooks.com PH: 9600175757 / 8124201000 / 8124301000


This is only for Sample Materials
for Full Book order online and available at all Leading Bookstores
308 Sura’s  XI Std - Computer Science ➠ Volume II ➠ Unit V ➠ Chapter 17
6. Which of the following is a set of moral principles (a) Spyware (b) Ransomware
that rule the behavior of individuals who use (c) Shareware (d) Moneyware
computers?  [Ans. (b) Ransomware]
(a) Cyber Crime (b) Ethics
15. Which of the following programs are self-
(c) Values (d) Mannerism
repeating and do not require a computer program
 [Ans. (b) Ehics]

m
to attach themselves?
7. Which of the following statement is time according (a) Virus (b) Spyware
to cyber world? (c) Ransomware (d) Worms
(i) Do not use priated software  [Ans. (d) Worms]

co
(ii) Do not use unauthorized user a accounts
16. Which of the following can lead to fraud or
(iii) Do not steal others password identity theft?
(a) only (i) (b) only (ii) (a) Phishing (b) Pharming
(c) only (iii) (d) All of these (c) Cookies (d) both a and b

s.
 [Ans. (d) All of these] (e) MITM [Ans. (d) both a and b]
8. Which of the following is not the common ethical 17. Which of the following also used to remember
issues?

ok
arbitrary pieces of information that the user
(a) Cyber crime (b) Authorized access previously entered into form fields?
(c) Hacking (d) Piracy (a) Phishing (b) Pharming
 [Ans. (b) Authorized access] (c) Cookie (d) Malware
9. Which of the following is an intellectual white-  [Ans. (c) Cookie]
collar crime?
o 18. Which can not be used to spread viruses?
(a) Cyber crime (b) Crime over area (a) Programs (b) Trojan
ab
(c) Crime over time (d) Organized crime (c) Worms (d) Cookies
 [Ans. (a) Cyber crime]  [Ans. (d) Cookies]
10. Which of the following crime that tricking people 19. Which of the following acts as an intermediary
into believing something is not true? between the end user and a web server?
ur

(a) Spam (b) Spoofing (a) Website (b) Web client


(c) Scam (d) Harvesting (c) Proxyserver (d) Network
 [Ans. (c) Scam]  [Ans. (c) Proxyserver]
.s

11. Which of the following is not used to prevent 20. Which of the following keep the frequently
unauthorized access? visited site addresses in its cache which improves
(a) Firewalls (b) IDS response time?
w

(c) Malware (d) Virus Scanners (a) Web server (b) Web client
 [Ans. (c) Malware] (c) Web browser (d) Proxy server
12. How many types of cyber attacks are there?  [Ans. (d) Proxy server]
w

(a) 3 (b) 5 (c) 2 (d) 4 21. Which of the following used to protect data in
 [Ans. (d) 4] communication system?
13. Which of the following is not a cyber attack?
w

(a) Encryption (b) Cipher-text


(a) Virus (b) Worms (c) Decryption (d) Spyware
(c) Firewalls (d) spyware  [Ans. (a) Encryption]
 [Ans. (c) Firewalls]
22. How many types of encryption are there?
14. Which of the following program that demands
payment after launching a cyber-attack on a (a) 3 (b) 2
computer system? (c) 4 (d) only one [Ans. (b) 2]

orders@surabooks.com PH: 9600175757 / 8124201000 / 8124301000


This is only for Sample Materials
for Full Book order online and available at all Leading Bookstores
Sura’s  XI Std - Computer Science ➠ Computer Ethics and Cyber Security 309

23. Which type of encryption use the same key for 3. Distribute unwanted email to a large number of
both encryption and description? internet users
(a) Public Key (b) Private Key (a) Scam (b) inbox
(c) Asymmetric Key (d) Symmetric Key (c) BCC (d) Spam
 [Ans. (d) Symmetric Key]  [Ans. (d) Spam]

m
4. "unauthorized copying of software" is called
II. Match List I with List II and Select (a) virus (b) worms
the Correct Answer using the Codes given (c) Hacking (d) software piracy
below.  [Ans. (d) software piracy]

co
5. Expansion of IDS is
1. Match the following.
(a) Identification Detection Systems
Function Crime (b) Intrusion Detection Software
(i) Harassing 1 Spam (c) Intrusion Digital Systems

s.
through online (d) Intrusion Detection Systems
(ii) Overloading a 2 Cyber stalking  [Ans. (d) Intrusion Detection Systems]
system with fake 6. The act of gaining illegal access to a computer is

ok
requests called
(iii) Manipulating data 3 identity theft (a) Hacking (b) Cracking
transfer money to (c) Phising (d) Piracy
an unauthorized o  [Ans. (a) Hacking]
account
(iv) Criminals 4 Fraud 7. Hacking can be protected by
impersonate (a) Malware (b) Virus
ab
individuals usually (c) Firewalls (d) Piracy
for financial gain  [Ans. (c) Firewalls]
Codes: 8. Who breaks into someone else's computer system
(i) (ii) (iii) (iv) called
ur

(a) 4 1 3 2 (a) Hacker (b) Cracker


(b) 1 3 2 4 (c) Breaker (d) Cipher
(c) 2 1 4 3  [Ans. (b) Cracker]
.s

(d) 3 4 1 2
9. Expansion of IRC
 [Ans. (d) (i)-2, (ii)-1, (iii)-4, (iv)-3]
(a) Internet Relay Chat
(b) Internet Religions Chat
w

III. Choose the Correct Option and Fill in


(c) Intenational Relay Chat
the Blanks.
(d) Internet Relay Cyber
1. Harassing through online, the crime called  [Ans. (a) Internet Relay Chat]
w

(a) Malware (b) Cyber Stalking 10. Phishing and pharming and examples of
(c) Fraud (d) Salami slicing (a) Social Engineering (b) Social Media
 [Ans. (b) Cyber Stalking] (c) Malware (d) firewalls
w

2. The crime stealing tiny amounts of money from  [Ans. (a) Social Engineering]
transaction is  [HF. 2018] 11. "Phishing without a trop" called
(a) Salami Slicing (b) Spyware (a) Hacking (b) Cracking
(c) Malware (d) Spam
(c) Pharming (d) Warehouse
 [Ans. (a) Salami Slicing]
 [Ans. (c) Pharming]

orders@surabooks.com PH: 9600175757 / 8124201000 / 8124301000


This is only for Sample Materials
for Full Book order online and available at all Leading Bookstores
310 Sura’s  XI Std - Computer Science ➠ Volume II ➠ Unit V ➠ Chapter 17
12. MITM also called (iii) Unauthorized copying of software is called
(a) Malware attack (b) Janus attack software piracy
(c) Virus attack (d) Spyware attack (a) only (i) (b) only (ii)
 [Ans. (b) Janus attack] (c) only (iii) (d) both (i) and (iii)
13. Encryption and decryption are done by  [Ans. (a) only (i)]

m
(a) GUI (b) Cryptography PART - II
(c) Cipher-text (d) Compiler
Very Short Answers 2 MARKS
 [Ans. (b) Cryptography]

co
14. Decrypted text is also called 1. What is meant by computer Ethics?
(a) Cryptography text Ans. Computer ethics deals with the procedures, values
(b) Plain text and practices that govern the process of consuming
computer technology and its related disciplines

s.
(c) Cipher - text
without damaging or violating the moral values and
(d) GUI text [Ans. (c) Cipher-text]
beliefs of any individual, organization or entity.
15. Public Key encryption is also called
2. Write few accepted standards in cyber world.

ok
(a) Symmetric key (b) asymmetric
(c) synchronous (d) all of these Ans. (i) Do not use pirated software.
 [Ans. (b) asymmetric] (ii) Do not use unauthorized user accounts.
(iii) Do not steal others' passwords.
16. Expansion of EDI is (ii) Do not hack.
(a) Electronic Data Interlink
o
(b) Electronic Data Information 3. What is cyber crime?
ab
(c) Electronic Data Interchange Ans. Cybercrime is an intellectual, white-collar crime.
(d) Electronic Digital Information Those who commit such crimes generally manipulate
 [Ans. (c) Electronic Data Interchange] the computer system in an intelligent manner.
4. What is Malware?
ur

IV. Point out the Wrong Statement in the Ans. Malicious programs that can perform a variety of
following. functions including stealing, encrypting or deleting
sensitive data, altering or hijacking core computing
1. Which of the following statement is false?
.s

functions and monitoring user's computer activity


(i) Users should not be truthful while using Internet without their permission.
(ii) Each should respect the privacy of other users.
(iii) Users should strictly obey the cyber lay in 5. What is Salami Slicing?
w

computer usage. Ans. Stealing tiny amounts of money from each transaction.
(iv) Users should share any information with
6. What is spoofing?
unauthorized people.
w

Ans. It is a malicious practice in which communication is


(a) only (iv) (b) Both (i) and (iii)
send from unknown source disguised as a source known
(c) Both (i) and (iv) (d) only (i)
to the receiver.
 [Ans. (c) both (i) and (iv)]
w

7. Name the crime for the following function.


2. Which of the following statement is false?
(i) Overloading a system with fake requests.
(i) Duplicating and selling copy righted programs is
(ii) Distributing unwanted e-mail to a large
called software piracy.
number of Internet users.
(ii) Downloading software illegally through network
(iii) Stealing conceptual information developed
is called software piracy.
by another person.

orders@surabooks.com PH: 9600175757 / 8124201000 / 8124301000


This is only for Sample Materials
for Full Book order online and available at all Leading Bookstores
Sura’s  XI Std - Computer Science ➠ Computer Ethics and Cyber Security 311

Ans. (i) Denial of Service Attack either by using an automated program or can be
(ii) Scam manually realized.
(iii) Spam. 17. What is meant by social engineering?
8. What does software piracy includes? Ans. Social Engineering is a method of getting passwords
and information using human weakness. These
Ans. It includes stealing of codes/ programs and other

m
crackers trick people, not software. They can use just
information illegally and creating duplicate copies the phone for getting information, they can pretend
by unauthorized means and utilizing this data either being your friend and talk to you on Internet Relay
for one's own benefit or for commercial profit. Chat(IRC) or by Instant messenger.

co
9. Write the types of software piracy? 18. What is meant by cyber attacks?
Ans. (i) Duplicating and selling copyrighted programs Ans. Cyberattacks are launched primarily or causing
(ii) Downloading software illegally through significant damage to a computer system or for
network. stealing important information from an individual or

s.
10. What is meant by unauthorized access? from an organization.
Ans. Unauthorized access is when someone gains access 19. What is Cyber security?
to a website, program, server, service, or other system

ok
Ans. Cyber security is a collection of various technologies,
by breaking into a legitimate user account.
processes and measures that reduces the risk of cyber
11. How will you prvent unauthorized access of a attacks and protects organizations and individuals
system? from computer based threats.
Ans. To prevent unauthorized access, Firewalls, Intrusion
o
Detection Systems (IDS), Virus and Content 20. What is Malware?
Scanners, Patches and Hot fixes are used. Ans. Malware is a type of software designed through
ab
12. Which may be done in pursuit of criminal activity which the criminals gain illegal access to software
or hobby? and cause damage.
Ans. Hacking. 21. Name the types of cyber security threats.
13. What is hacking leads to? Ans. (i) Social Engineering
ur

Ans. Hacking leads to Identity theft or gaining personal (ii) Man In the Middle
information. Firewalls, passwords and user Id's, anti (iii) Cookies.
hacking software.
22. What is virus?
.s

14. Who is called black hat or dark side hacker?


Ans. A virus is a small piece of computer code that can
Why?
repeat itself and spreads from one computer to
Ans. (i) A cracker (also called a black hat or dark side
another by attaching itself to another computer file.
w

hacker) is a malicious or criminal hacker.


(ii) A cracker is someone who breaks into someone 23. What is Trojan?
else's computer system, often on a network, Ans. A Trojan virus is a program that appears to perform
by passing passwords or licenses in computer
w

one function (for example, virus removal) but


programs. actually performs malicious activity when executed.
15. Name the types of cracking.
24. Define worms.
w

Ans. (i) Software Cracking


Ans. Worms are self- repeating and do not require a
(ii) Password Cracking.
computer program to attach themselves. Worms
16. What is software cracking and password continually look for vulnerabilities and report back
cracking?
to the author of the worm when weaknesses are
Ans. Software cracking is the most often used type of
discovered.
cracking which is nothing but removing the encoded
copy protection. Password cracking can be perform

orders@surabooks.com PH: 9600175757 / 8124201000 / 8124301000


This is only for Sample Materials
for Full Book order online and available at all Leading Bookstores
312 Sura’s  XI Std - Computer Science ➠ Volume II ➠ Unit V ➠ Chapter 17
25. What is meant by Ransomware? 33. Give an example of encryption.
Ans. Ransomware is a type of malicious program that Ans. Data being transferred via networks (e.g. the
demands payment after launching a cyber-attack on a Internet, e-commerce), mobile telephones, wireless
computer system. This type of malware has become microphones, wireless intercom systems, Bluetooth
increasingly popular among criminals and costs the devices and bank automatic teller machines.

m
organizations millions each year. 34. Write the disadvantage of the symmetric key
encryption.
26. What is proxy server?
Ans. The main disadvantage of the symmetric key
Ans. Aproxy server acts as an intermediary between the

co
encryption is that all authorized persons involved,
endusersand a web server.
have to exchange the key used to encrypt the data
27. How proxy servers improves response time? before they can decrypt it. If anybody intercepts the
Ans. Proxy servers keep the frequently visited site key information, they may read all message.

s.
addresses in its cache which leads to improved 35. Write a note on Asymmetric encryption.
response time. Ans. Public Key Encryption :
28. Which determines the functional output of (i) Public key encryption is also called Asymmetric

ok
cryptographic algorithm? encryption. It uses the concept of a key value
pair, a different key is used for the encryption
Ans. In cryptography a key is a piece of information
and decryption process. One of the keys is
(parameter) that determines the functional output of
typically known as the private key and the other
a cryptographic algorithm. is known as the public key.
o
29. Difference between encryption and decryption. (ii) The private key is kept secret by the owner
Ans. Encryption Decryption and the public key is either shared amongst
ab
authorized recipients or made available to the
Encryption is the Decryption is the public at large.
process of translating reverse process of
(iii) The data encrypted with the recipient's
the plain text data converting the cipher-
public key can only be decrypted with the
(plain text) into random text back to plaintext.
corresponding private key.
ur

and mangled data


(called cipher-text), 36. What are the forms asymmetric encryption used?
30. Which can be done by cryptography? Ans. In the form of
(i) Digital certificates
.s

Ans. (i) Encryption


(ii) Decryption. (ii) Digital signature.

31. Explain the working of proxy server. 37. What is IT Act 2000?
w

Ans. Ans. IT Act 2000 is an act to provide legal recognition


for transactions carried out by means of Electronic
Data Interchange(EDI) and other means of
w

electronic communication. It is the primary law


in India dealing with cybercrime and electronic
commerce(e-Commerce).
38. Define cyber law.
w

Ans. Cyber law or Internet law is a term that encapsulates


32. Explain the uses of encryption.
the legal issues related to use of the Internet.
Ans. Encryption has been used by militaries and
governments to facilitate secret communication. It 39. What are the points to be noted to protect the
is now commonly used in protecting information network information?
within many kinds of civilian systems. It is also used Ans. To protect the information the following points to be
to protect data in communication system. noted :

orders@surabooks.com PH: 9600175757 / 8124201000 / 8124301000


This is only for Sample Materials
for Full Book order online and available at all Leading Bookstores
Sura’s  XI Std - Computer Science ➠ Computer Ethics and Cyber Security 313

(i) Complex password setting can make your surfing PART - IV


secured.
(ii) When the internet is not in use, disconnect it. Long Answers 5 MARKS
(iii) Do NOT open spam mail or emails that have an 1. Explain social engineering with an example.
unfamiliar sender.
Ans. (i) Social engineering : A misuse of an individual’s
(iv) When using anti-virus software, keep it up-to-

m
date. weakness, achieved by making them to click
malicious links, or by physically accessing the
40. What is authenticity? computer through tricks. Phishing and pharming

co
Ans. The quality of being real or true. are examples of social engineering.
41. Who is called perpetrator? (ii) Phishing : Phishing is a type of computer crime
Ans. A person who carriers out a harmful, illegal, or used to attack, steal user data, including login
immoral act. name, password and credit card numbers. It

s.
42. Define Hacking. occurs when an attacker targets a victim into
Ans. Hacking is gaining unauthorized access to computer opening an e-mailor an instant text message.
system without the owner's permission. The attacker uses phishing to distribute

ok
43. Define cracking. malicious links or attachments that can perform
Ans. Cracking is gaining unauthorized access to computer a variety of functions. including the extraction
systems to commit a crime, such as stealing the code of sensitive login credentials from victims.
to make a copy-protected program run thus denying (iii) Pharming : Pharming is a scamming practice in
service to legitimate users.
o which malicious code is installed on a personal
44. Differentiate freeware and shareware. computer or server, misdirecting users to
ab
Ans. Freeware Shareware fraudulent web sites without their knowledge or
Freeware is a software Shareware is a software permission. Pharming has been called "phishing
available free of that is distributed free without a trap': It is another way hackers attempt
charge. of charge on a trial to manipulate users on the Internet. It is a cyber-
ur

basis for a limited time. attack intended to redirect a website's traffic to a


45. Define Phishing. fake site.
Ans. Phishing is a term used to describe a malicious 2. Write the reasons now websites typically use
.s

individual or group of individuals who scam users cookies.


by sending e-mails or creating web pages that are Ans. Web sites typically use cookies for the following
designed to collect an individual's online bank, credit
reasons:
card, or other login information.
w

(i) To collect demographic information about who


46. Define firewall. has visited the Web site.
Ans. Afirewall is a network security system that monitors (ii) Sites often use this information to track how
w

and controls incoming and outgoing network traffic often visitors come to the site and how long
based on predetermined security rules. they remain on the site.
47. Write a note on Janus attack. (iii) It helps to personalize the user's experience on
w

Ans. Man-in-the-middle attack (MITM; also Janus attack) the Web site.
is an attack where the attacker secretly relays and (iv) Cookies can help store personal information
possibly alters the communication between two about users so that when a user subsequently
parties who believe they are directly communicating returns to the site, a more personalized
with each other.
experience is provided.

orders@surabooks.com PH: 9600175757 / 8124201000 / 8124301000


This is only for Sample Materials
for Full Book order online and available at all Leading Bookstores
314 Sura’s  XI Std - Computer Science ➠ Volume II ➠ Unit V ➠ Chapter 17
3. Explain the different types of encryption. well as acknowledging informed by the signer.
Ans. Types of Encryption : There are two types of (ii) To create a digital signature, signing software
encryption schemes as listed below: Symmetric Key (email) creates a one-way hash of the electronic
encryption, Public Key encryption. data to be signed.
(i) Symmetric Key Encryption : Symmetric (iii) The user's private key to encrypt the hash,

m
encryption is a technique to use the same key returning a value that is unique to the hashed data.
The encrypted hash, along with other information
for both encryption and decryption. The main
such as the hashing algorithm, forms the digital
disadvantage of the symmetric key encryption
signature. Any change in the data, even to a single

co
is that all authorized persons involved, have to
bit, results in a different hash value.
exchange the key used to encrypt the data before
they can decrypt it. If anybody intercepts the key
information, they may read all message. Depicts

s.
the working of symmetric key encryption.
(iii) Public Key Encryption: Public key encryption
is also called Asymmetric encryption. It uses the

ok
concept of a key value pair, a different key is used
for the encryption and decryption process. One of
the keys is typically known as the private key and
the other is known as the public key. The private
o
key is kept secret by the owner and the public key (iv) This attribute enables others to validate the
is either shared amongst authorized recipients or integrity of the data by using the signer's public
ab
made available to the public at large. The data key to decrypt the hash. If the decrypted hash
encrypted with the recipient's public key can only matches a second computed hash of the same
be decrypted with the corresponding private key. data, it proves that the data hasn't changed since
public key encryption. it was signed.
ur

4. Explain the function of digital signature. (v) If the two hashes don't match, the data has either
Ans. Digital signature :  [HF. 2018] been tampered with in some way (indicating a
(i) Digital signatures are based on asymmetric failure of integrity) or the signature was created
.s

cryptography and can provide assurances of with a private key that doesn't correspond to the
evidence to origin, identity and status of an public key presented by the signer (indicating a
electronic document, transaction or message, as failure of authentication).
w


w
w

orders@surabooks.com PH: 9600175757 / 8124201000 / 8124301000


This is only for Sample Materials
for Full Book order online and available at all Leading Bookstores

Chapter
18 Tamil computing

m
co
CHAPTER SNAPSHOT

s.
 18.1. Introduction
 18.2. Tamil in Internet

ok
 18.3. Search Engines in Tamil
 18.4. e-Governance
 18.5. e-Library
o
 18.6. Tamil Typing and Interface Software
18.6.1. Familiar Tamil Keyboard Interface
ab
 18.7. Tamil Office Automation Applications
 18.8. Tamil Translation Applications
 18.9. Tamil Programming Language
ur

 18.10. Tamil Information Interchange Coding Systems


 18.11. Tamil Operating System
 18.12. Organisation and Projects to develop Tamil
.s
w
w
w

[315]

orders@surabooks.com PH: 9600175757 / 8124201000 / 8124301000


This is only for Sample Materials
for Full Book order online and available at all Leading Bookstores
316 Sura’s  XI Std - Computer Science ➠ Volume II ➠ Unit V ➠ Chapter 18

Evaluation
Answer to the following questions : 
1. List of the search engines supporting Tamil.
Ans. (i) G  oogle
4. What is TSCII?

m
(ii) Bing
Ans. TSCII (Tamil Script Code for Information
(iii) yahoo.
Interchange) is the first coding system to handle our
What are the keyboard layouts used in Android?

co
2. Tamil language in an analysis of an encoding scheme
Ans. (i) Q  uerty that is easily handled in electronic devices, including
(ii) Emoji non-English computers. This encoding scheme was
(iii) Sellinam registered in lANA (Internet Assigned Numbers
Authority) unit of ICANN.

s.
(iv) Ponmadal.
3. Write a short note about Tamil Programming 5. Write a short note on Tamil Virtual Academy.
Language. Ans. With the objectives of spreading Tamil to the entire

ok
Ans. Programming languages to develop software to world through internet, Tamil Virtual University was
computers and smart phones are available only established on 17th February 2001 by the Govt. of
in English. Now, efforts are taken to develop Tamilnadu. Now, this organisation functioning with
programming languages in Tamil. Basedon Python the name "Tamil Virtual Academy': This organisation
o
programming language,the first Tamil programming offers different courses regarding Tamil language,
language "Ezhil" (vÊš) is designed. With the help of Culture, heritage etc., from kindergarten to under
ab
this programming language, you can write simple graduation level.
programs in Tamil.

additional questions and Answers


ur

4. In India, Which is the most widely language in


Internet?
I. Choose the Correct options for the
(a) Tamil (b) Hindi
below Questions.
.s

(c) Kannada (d) Malayalam


 [Ans. (a) Tamil]
1. Which of the following plays a vital role in ever
man's life? 5. How many percentage of Internet users consider
w

(a) Mobile (b) Computer local language digital content to be more reliable
(c) Internet (d) Laptop than english?
 [Ans. (c) Internet] (a) 42% (b) 52%
w

(c) 68% (d) 48%


2. Which of the following is the best informatikon
 [Ans. (c) 68%]
technological device?
(a) Computer (b) Internet 6. Which year onwards, 74% if people in India will
w

(c) Mobile (d) Notebook Computer access Internet using Tamil?


 [Ans. (b) Internet] (a) 2019 (b) 2021
(c) 2023 (d) 2030
3. How many percentage of people using Internet is
 [Ans. (b) 2021]
Tamil?
(a) 40% (b) 43% 7. Which of the following are used to search any
information from the cyberspace?
(c) 50% (d) 42% [Ans. (d) 42%)]

orders@surabooks.com PH: 9600175757 / 8124201000 / 8124301000


This is only for Sample Materials
for Full Book order online and available at all Leading Bookstores
Sura’s  XI Std - Computer Science ➠ Tamil Computing 317

(a) Operating System 16. Which of the following application have more
(b) Compiler than 30000 Tamilwords equivalent to enlglish
(c) Search engines words?
(d) Web clients [Ans. (c) Search engines] (a) Kamban (b) Thamizpori
(c) Vani (d) Ponmozhi
8. Which of the following provide searching facilities
 [Ans. (b) Thamizpori]

m
in Tamil?
(a) Google (b) Bing 17. Which of the following language used to design
(c) Safari (d) both a and b ''Ezhil''? Tamil programming language?
 [Ans. (d) both a and b] (a) C (b) C++

co
(c) Java (d) Python
9. Which of the following is not provide searching
 [Ans. (d) Python]
facilities in Tamil?
(a) Yahoo (b) Safari 18. Which of the following coding systems specially
(c) Bing (d) Google designed for Indian languages?

s.
 [Ans. (b) Safari] (a) ASCII (b) TSCII
(c) ISCII (d) EBCDIC
10. Which of the following search engine gives Tamil
 [Ans. (c) ISCII]
virtual keyboard?

ok
(a) Bing (b) Yahoo 19. Which encoding scheme is suitable to handle
(c) Safari (d) Google Tamil?
 [Ans. (d) Google] (a) ASCII (b) ISCII
11. Which country provides all their services through
o (c) Unicode (d) BCD
the official website in Tamil?  [Ans. (c) Unicode]
(a) Srilanka (b) America
20. In India, 42% of users mostly used language in
ab
(c) Singapore (d) Malaysia
india?
 [Ans. (a) Srilanka)]
(a) Tamil (b) Kannada
12. Which of the following are portal or website of
(c) Malayalam (d) Telugu
books collection?
 [Ans. (a) Tamil]
ur

(a) E-Papers (b) E-Commere


(c) E-languages (d) E-libraries III. Choose the Correct Option and Fill in
 [Ans. (d) E-libraries]
the Blanks.
13. Which of the following is not a familiar Tamil
.s

keyboard interfaces software? 1. Getting Government services through internet is


(a) NHM Writer (b) Ponmadal known as
(c) E-Kalappai (d) Lippikar (a) e-filling (b) e-payment
w

 [Ans. (b) Ponmadal] (c) e-governance (d) e-shopping


 [Ans. (c) e-governance]
14. In white OS, Sellinam Tamil keyboard layout
works? 2. The first programming language "Ezhil" is
w

(a) windows (b) linux designed by


(c) Android (d) iOS (a) C++ (b) Java
 [Ans. (c) Android] (c) Python (d) Visual Basic
w

 [Ans. (c) Python]


15. Which of the following Tamil keyboard layout not
used by Android OS? 3. The ASCII encoding system is applicable only for
(a) NHM Wirter (b) E-Kalappai handling the language
(a) English (b) Hindi
(c) Lippikar (d) All of these
(c) Tamil (d) All of these
 [Ans. (d) All of these]
 [Ans. (a) English]

orders@surabooks.com PH: 9600175757 / 8124201000 / 8124301000


This is only for Sample Materials
for Full Book order online and available at all Leading Bookstores
318 Sura’s  XI Std - Computer Science ➠ Volume II ➠ Unit V ➠ Chapter 18
4. The first version of Unicode is automation software working exclusively for Tamil.
(a) 1.0.0 (b) 1.0.1 6. Write a short note on "Thamizpori".
(c) 0.0.1 (d) 0.1.1 [Ans. (a) 1.0.0]
Ans. Thamizpori (jÄœbgh¿) is a Tamil translation application
5. The first version of Unicode introduced in the year having more than 30000 Tamil words equalent to
(a) 1990 (b) 1998 English words. Using this application. we can transalte

m
(c) 1991 (d) 1981 small English sentences into Tamil.
 [Ans. (c) 1991]
7. Expand
6. The first Tamil programming language is (i) TSCII (ii) ISCII (iii) ASCII

co
(a) Ezhil (b) Kuzhal Ans. (i) T  amil Script Code for Information Interchange
(c) Thamizpori (d) kamban (ii) Indian Script Code for Information Interchange
 [Ans. (a) Ezhil] (iii) Ameircan Standard Code for Information
Interchange.

s.
PART - II
8. Write a short note on Madurai project.
Very Short Answers 2 MARKS Ans. Project Madurai is an open and voluntary initiative to

ok
collect and publish free electronic editions of ancient
1. What is e-governance?
tamil literary classics. This means either typing-in or
Ans. Getting Government services through internet is
scanning old books and archiving the text in one of the
known as e-Governance. Govt. of Tamilnadu has
most readily accessible formats for use on all popular
been giving its services through Internet. computer platforms.
2. What is the use of e-libraries?
o
9. Write a note on Unicode.
ab
Ans. E-Libraries are portal or website of collection of Ans. Unicode is an encoding system, designed to handle
e-books. Tamil e-Library services provide thousands various world languages, including Tamil. Its first
of Tamil Books as e-books mostly at free of cost. It is version 1.0.0 was introduced on October 1991. While
introduction of this scheme, can be able to handle
the most useful service to Tamil people who live far
nearly 23 languages including Tamil. Among the
ur

away from their home land.


various encoding scheme, Unicode is the suitable to
3. What is the use of Tamil interfaces software? handle Tamil.
Ans. Tamil interface software is the familiar one among the
.s

different. Methods of typing. This is the simplest method


of typing Tamil in both Computer and Smart phones.

w

4. What are the familier keyboard used for Tamil


typing?
Ans. (i) N HM Writer, E-Kalappai and Lippikar - are
w

familiar Tamil keyboard interfaces software thai


is used for Tamil typing which works on Tamil
Unicode, using phonetics.
w

(ii) Sellinam and Ponmadal - are familiar Tamil


Keyboard layouts that works on Android operating
system in smart phone using phonetics.
5. List some Tamil Automation softwares.
Ans. Tamil Libra Office, Tamil Open Office, Azhagi Unicode
Editor, Ponmozhi, Menthamiz, Kamban, Vani are office

orders@surabooks.com PH: 9600175757 / 8124201000 / 8124301000


This is only for Sample Materials
for Full Book order online and available at all Leading Bookstores

11 th GOVT. MODEL QUESTION PAPER - 2018


STD
Time Allowed : 2.30 hours COMPUTER SCIENCE Maximum Marks : 70

m
Section- I
7. Which icon is clicked to see disk drives mounted
Note : (i) All questions are compulsory. in the system
(ii) Choose the most suitable answer from the (a) Computer (b) My Computer

co
given four alternative and write the option
code and the corresponding answer. (c) Drive icon (d) Device driver
 (15 × 1 = 15) 8. The default application in Ubuntu similar to
1. Which component is used in the Second generation MS-Excel in Windows is
(a) Spreadsheet (b) Libre Office suite

s.
computers?
(a) Vacuum tube (c) Open Office calc (d) Star office calc
(b) Transistor 9. If i:=7 before the assignment, i:=i*2. The value of

ok
(c) Integrated Circuits i after the assignment is
(d) Microprocessor (a) 2 (b) 7
2. Which one of the following coding system is (c) 14 (d) 49
integrated with Unicode? 10. What are the values of variables m and n after the
(a) BCD (b) ASCII
o assignments in line1 and line3
(c) EBCDIC (d) ISCII
ab
1. m,n:=120,150
3. Match the following
2. —m.n = ?, ?
(a) CD ROM 1. 4.7 GB
3. m,n:= m+3, n-1
(b) DVD 2. 50 GB
4. .—m.n = ?, ?
ur

(c) Flash memory 3. 700 MB


(d) Blu ray disc 4. 2 TB (a) 123 and 153 (b) 123 and 149
(a) 3,2,1,4 (b) 3,1,4,2 (c) 153 and 119 (d) 120 and 150
.s

(c) 4,1,2,3 (d) 1,2,3,4 11. Which refers to the software in which the source
4. Which one of the following is the file system of code is available for free
Linux? (a) Source (b) Source code
w

(a) NTFS (b) DAT (c) Open source (d) Anytime source
(c) Time sharing (d) EXT2 12. Expanding each sub-program into more detailed
w

5. Which of the following was developed by Google. steps is known as


(a) Android TV (b) Android Auto (a) Composition (b) Decomposition
w

(c) Android wear (d) All the given (c) Abstraction (d) Refinement
6. Which icon in Windows 10 is same as ‘My 13. A condition in a flowchart is represented by a shape
Computer’ in Windows XP? like
(a) PC (b) My PC (a) Diamond (b) Rectangle
(c) Computer (d) This PC (c) Circle (d) Oval
[319]

orders@surabooks.com PH: 9600175757 / 8124201000 / 8124301000


This is only for Sample Materials
for Full Book order online and available at all Leading Bookstores

320 Sura’s  XI Std - Computer Science - Govt. Model Question Paper 2018

14. Given u,v:=u+3,v+3, which of the following is 32. Given the following (S1,S2,S3,S4 &S5 are
invariant? statements)
(a) u-v (b) uv 1 - - Write the control flow
2 - - a,b
(c) u+v (d) u/v
3 S1

m
15. The algorithm design technique closely related to 4 case a=b
iteration but more powerful is 5 S2
(a) Iteration (b) loop invariant 6 case a>b

co
(c) Recursion (d) composition 7 S2
8 else
Section - II 9 S4
10 S5

s.
Answer any Six questions. Question No. 24 is Initially if a=200 and b=30, Write the statements
compulsory. (6 × 2= 12) through which the control flows.
33. King Vikramaditya has two magic swords. With

ok
16. Expand (a)BIOS (b)ENIAC (c)RAM (d)ALU
one, he can cut off 19 heads of a dragon, but after
17. Give ASCII codes for the characters A and Z? that the dragon grows 13 heads. With the other
18. Write note on AND gate. sword, he can cut off 7 heads, but 22 new heads
19. What is GUI?
20.
o
What are the two types of windows available in
grow. If all heads are cut off, the dragon dies. If the
dragon has originally 1000 heads, can it ever die?
ab
Windows XP? (Hint:The number of heads mod 3 is invariant.)
21. Distinguish between a condition and a statement. (or)
22. What is a Launcher in Ubuntu? Design a iterative algorithm to find sum of first n
23. Distinguish between an algorithm and a process. natural numbers. S=1 + 2 + 3 +..... +n
ur

24. What is a loop invariant? Give example


Section - IV
(or)
Answer all questions. (5 × 5 = 25)
What is recursive problem solving? Give example.
.s

Section - III 34. Explain the basic components of a computer with


a neat diagram.
Answer any six questions. Question No. 33 is
w

compulsory. (6 × 3 = 18) (or)

25. Write the sequence of steps in boot process? Convert the following to binary, then convert
w

the binary number to hexadecimal


26. Find 2’s complement of (a)-22 (b) -35
(a) 456 (b) 855
27. Write briefly about Blu-ray disc.
w

28. Write a note on Android Operating System. 35. Explain Bubbled AND , Bubbled OR gates.
29. Differentiate between switch user and log off. (or)
30. What is the difference between the statement
(a) What is a clock speed? How it is measured?
b:=a+5 and b=a+5
(b) What is a word size?
31. Write the specification and algorithm to find the
(c) What is MDR?
minimum of two given numbers.

orders@surabooks.com PH: 9600175757 / 8124201000 / 8124301000


This is only for Sample Materials
for Full Book order online and available at all Leading Bookstores

Sura’s  XI Std - Computer Science - Govt. Model Question Paper 2018 321
36. How will you copy files and folders to removable 5. (d) All the given
disk? 6. (d) This PC
(or) 7. (b) My Computer
Suppose you want to evaluate y for value of x 8. (b) Libre Office suite
5 x 9. (c) 14

m
using the expression y =
( −3)( −1) 10. (b) 123, 149
Write suitable algorithm specification
11. (c) Open source

co
37. Trace the step by step execution of the algorithm 12. (d) Refinement
for Factorial(3) 13. (a) Diamond
Factorial(n) 14. (a) u-v
- - - inputs: n is an integer, n≥0 15. (c) Recursion

s.
- - - outputs: F=n!
Section- II
F,i:=1,1
While i<n 16. a) BIOS - Basic Input Output System.

ok
F,i:=F*i, i+1 b) ENIAC - E  lectronic Numerical Integrator
(or) And Calculater.
Write specification and algorithm using iterative c) RAM - Random Access Memory
statement to find ab.
o d) ALU - Arithmetic and Logic unit
38. Briefly discuss about loop invariant. 17. ASCII codes for the characters
ab
A = 65
(or)
Z = 90
18. The AND gate can have two or more input signals

{
Power can be defined recursively as
1 if n = 0 and produce an output signal. The output is "true"
ur

only when both inputs are "true", otherwise, the


a =
n
a x an -1 if n is odd output is "false". In other words the output will
a n/2 x a n/2 if n is even be 1 if and only if both inputs are 1; otherwise
the output is 0. The output of the AND gate is
.s

Construct a recursive algorithm using this


represented by avariable say C, where A and B
definition. How many multiplications are needed
are two and if input boolean variables.
to calculate a10? Illustrate by a diagram.
19. The GUI is a window based system with a pointing
w

 device to direct I/O, choose from menus, make


selections and a keyboard to enter text. Its vibrant
colours attract the user very easily.
Answer
w

20. Windows XP Starter


Windows XP Home.
Section- I
w

21. A condition is a phrase that describes a test of the


state. A statement is a phrase that commands the
1. (b) Transistor computer to do an action.
2. (d) ISCII 22. Launcher: The vertical bar of icons on the left
side of the desktop is called the Launcher. The
3. (b) 3,1,4,2
Launcher provides easy access to applications,
4. (d) EXT2 mounted devices, and the Trash.

orders@surabooks.com PH: 9600175757 / 8124201000 / 8124301000


This is only for Sample Materials
for Full Book order online and available at all Leading Bookstores

322 Sura’s  XI Std - Computer Science - Govt. Model Question Paper 2018

23. The difference between algorithm and process is 26. (a) -22
that algorithm is a precise step by step plan for 2 22
a computational procedure that possibly begins
2 11 – 0
with an input value and yields an output value in a
finite number of steps while process is a particular 2 5 –1

m
method for performing a task. 2 2 –1
24. An invariant the loop body is known as a loop 1 –0
invariant.

co
Example : The specification and the loop invariant = 101102
are shown as comments. Binary equivalent of + 22 = 10110
power (a, n) 8 bit format = 00010110
-- inputs: n is a positive integer 1’s complement = 11101001

s.
-- outputs: p = an 2’s complement - 22 = +1
p, i := 1 , 0 11101010
while i ≠ n

ok
(b) -35
-- loop invariant: p = a1 2 35
p, i :=p × a, i+1 2 17 – 1
2 8–1
(or) o 2 4–0
Recursion is an algorithm design technique, closely 2–0
1–0
related to induction. It is similar to iteration, but
ab
more powerful. Using recursion, we can solve a Binary equivalent of + 22 = 100011
problem with a given input, by solving the intances 8 bit format = 00100011
of the problem with a part of the input. 1’s complement = 11010101
Example : Customers are waiting in a line at a 2’s complement - 35 = +1
ur

counter. The man at the counter wants to know 11011101


how many customers are waiting in the line.
27. Blu-Ray Disc is a high-density optical disc similar
Section- III
to DVD. Blu-ray is the type of disc used for
.s

25. Booting process is of two types. PlayStation games and for playing High-Definition
(i) Cold Booting (ii) Warm Booting (HD) movies. A double-layer Blu-Ray disc can
(i) Cold Booting: When the system starts store up to 50GB (gigabytes) of data. This is more
w

from initial state i.e. it is switched on, than 5 times the capacity of a DVD, and above
we call it cold booting or Hard Booting. 70 times of a CD. The format was developed to
When the user presses the Power button, enable recording, rewriting and playback of high-
w

the instructions are read from the ROM to definition video, as well as storing large amount
initiate the booting process. of data. DVD uses a red laser to read and write
(ii) Warm Booting: When the system restarts data. But, Blu-ray uses a blue-violet laser to write.
w

or when Reset button is pressed, we call it Hence, it is called as Blu-Ray.


Warm Booting or Soft Booting. The system 28. Android is a mobile operating system developed
does not start from initial state and so all by Google, based on Linux and designed primarily
diagnostic tests need not be carried out in for touch screen mobile devices such as smart
this case. There are chances of data loss and phones and tablets. Google has further developed
system damage as the data might not have
Android TV for televisions, Android Auto for cars
been stored properly.
and Android Wear for wrist watches, each with a

orders@surabooks.com PH: 9600175757 / 8124201000 / 8124301000


This is only for Sample Materials
for Full Book order online and available at all Leading Bookstores

Sura’s  XI Std - Computer Science - Govt. Model Question Paper 2018 323
specialized user interface. Variants of Android are (or)
also used on game consoles, digital cameras, PCs Input : n = 3
and other electronic gadgets. Output : 10
29. Switch User: Switch to another user account on Sum of first natural numbe r: 1
the computer without closing your open programs Sum of first and second natural number : 1+2=3

m
and Windows processes. Sum of first, second and third natural number
Log off : Switch to another user account on the = 1+2+3 =6
computer after closing all you open programs and Sum of first three natural number = 1+2+3+6=10

co
windows processes.
Input : n = 2
30. The left side is a comma - separate list of variables. Output : 4.
The right side is a comma separated list of Section- IV
expressions. To execute an assignment statement,
34. Components of a Computer : The computer

s.
first evaluate all the expressions on the right side
using thecurrent values of the variables, and then is the combination of hardware and software.
store them in the corresponding variables on the Hardware is the physical component of a
computer like motherboard, memory devices,

ok
left side.
monitor, keyboard etc., while software is the set
31. minimum (a,b) of programs or instructions. Both hardware and
-- input : s : a, b software together make the computer system to
-- output : result = a↓ b o function.
Algorithm minimum can be defined as Central Processing Unit : CPU is the major
1. minimum (a,b) component which interprets and executes software
ab
2. -- a, b instructions. It also control the operation of all
other components such as memory, input and
3. if a <b
output units.
4. result : = a Arithmetic and Logic Unit :
5. else
(i) The ALU is a part of the CPU where various
ur

6. result = b
computing functions are performed on data.
7. -- result = a↓ b.
(ii) The ALU performs arithmetic operations
32. 1. Compare (200,30) such as addition, subtraction, multiplication,
.s

2. case 200 ∠ 30 division and logical operations.


3. result : = -1 Control Unit

4. case 200 = 30 ALU


5. result ; = 0
w

Input Unit Output Unit


Internal
6. else .. 200 >30 Memory Data Path
Control Path

7. result : = 1 Main Memory


w

33. Let the numer pf heads = u Secondary Storage


Components of a Computer
Model : First swords are using u:u - 19+13 Memory Unit :
=u-6 (i) The Memory Unit is of two types which are
w

Second scoords are using u : = u - 7+22 = u + 15 primary memory and secondary memory.
But one of the round u is divisor by 3 then The primary memory is used to temporarily
remainder is equal. Any one of the numbers store the programs and data when the
divisible by 3 sun remainder is 0 or 1 or 2 u is the instructions are ready to execute. The
need for zero. secondary memory is used to store the data
permanently.

orders@surabooks.com PH: 9600175757 / 8124201000 / 8124301000


This is only for Sample Materials
for Full Book order online and available at all Leading Bookstores

324 Sura’s  XI Std - Computer Science - Govt. Model Question Paper 2018

(ii) The Primary Memory is volatile, that is, A A


the content is lost when the power supply is C=A . B
switched off. The Random Access Memory
B B
(RAM) is an example of a main memory.
(iii) The Secondary memory is non volatile, that In the above circuit, inverters on the input lines of

m
is, the content is available even after the the AND gate gives the output as C = ( A . B).
power supply is switched off. Hard disk, A
C
CD-ROM and DVD ROM are examples of B

co
secondary memory.
This circuit can be redrawn as the bubbles on the
(or)
(a) 456 Binary Number inputs, where the bubbles represent inversion.
We refer this as bubbled AND gate. Let us analyses
Quotient Remainder

s.
this logic circuit for all input possibilities.
456/2 228 0
228/2 114 0 If A = 0 and B = 0 C=(0.0) = 1.1 = 1
114/2 57 0 If A = 0 and B = 1 C=(0.1) = 1.0 = 0

ok
57/2 28 1 If A = 1 and B = 0 C=(1.0) = 0.1 = 0
28/2 14 0 If A = 1 and B = 1 C=(1.1) = 0.0 = 0
14/2 7 0
Here the truth table is
7/2 3 1
3/2 1
o1
Input Output
A B C
1/2 0 1
ab
0 0 1
Binary Number = (111001000) 2
Hexadecimal Number = (1C8) 16 0 1 0
(b) 855 1 0 0
Quotient Remainder
ur

1 1 0
855/2 427 1
You can see that, a bubbled AND gate produces the
427/2 213 1
same output as a NOR gate. So, You can replace
213/2 106 1
.s

each NOR gate by a bubbled AND gate. In other


106/2 53 0
words the circuits are interchangeable.
53/2 26 1
Therefore
26/2 13 0
w

(A + B) = A . B
13/2 6 1
6/2 3 0 Which establishes the De Morgan’s first theorem.
3/2 1 1
w

1/2 0 1 Bubbled OR gates : The logic circuit of bubbled


Binary Number = (1101010111) 2 OR gate is The output of this circuit can be written
Hexadecimal Number = (357) 16 as C = A + B
w

The above circuit can be redrawn as the bubbles


on the input, where the bubbles represents the
35. Bubbled AND Gate : The Logic Circuit of
Bubbled AND Gate. inversion.
We refer this as bubbled OR gate. The truth table
for the bubbled OR is

orders@surabooks.com PH: 9600175757 / 8124201000 / 8124301000


This is only for Sample Materials
for Full Book order online and available at all Leading Bookstores

Sura’s  XI Std - Computer Science - Govt. Model Question Paper 2018 325

Input Output (i) Click Start → Computer.


A B C (ii) Double-click on the Removable Disk
0 0 1 associated with the USB flash drive.
0 1 1 (iii) Navigate to the folders in your computer
containing files you want to transfer. Right-

m
1 0 1
click on the file you want to copy, then select
1 1 0 Copy.
(iv) Return to the Removable Disk window, right-

co
(or)
click within the window, then select Paste.
(a) Clock Speed :
METHOD 2 : Drag and Drop
(i) Every microprocessor has an internal clock
that regulates the speed at which it executes (i) Plug the USB flash drive directly into an

s.
instructions. available USB port.
(ii) The speed at which the microprocessor (ii) Allow the computer to recognize the drive,
executes instructions is called clock speed. then click Start → Computer.

ok
Clock speed is measured in MHz or in GHz. (iii) Navigate to the folders in your computer
containing files you want to transfer.
(b) Word Size :
(iv) Click and drag the files you want to the
(i) The number of bits that can be processed by
Removable Disk.

its word size.


o
a processor in a single instruction is called
(v) Release the mouse.
METHOD 3 : Send To (Windows)
ab
(ii) Word size determines the amount of RAM
that can be accessed by a microprocessor at (i) Plug the USB flash drive directly into an
one time and the total number of pins on the available USB port.
microprocessor. (ii) Navigate to the folders in your computer
(iii) Total number of input and output pins in containing files you want to transfer.
ur

turn determines the architecture of the (iii) Right-click on the file you want to transfer
microprocessor. to your removable disk.
(c) Word MDR : (iv) Click Send To and select the Removable Disk
.s

(i) Memory Data Register is the register of a associated with the USB flash drive.
computer’s control unit that contains the METHOD 4 : Copy and Paste using keyboard
data to be stored in the computer storage (Eg.
w

RAM). shortcuts (Windows)

(ii) It is also called Memory Buffer Register. (i) Plug the USB flash drive directly into an
available USB port.
w

36. There are several methods of transferring files to


or from a removable disk. (ii) Click on your desired file to select it.
(i) Copy and Paste (iii) On your keyboard, hold down the Ctrl key
and press C.
w

(ii) Drag and Drop


(iii) Send To (iv) Navigate to the desired folder destination.
(iv) Copy and Paste using keyboard shortcuts (v) Hold down the Ctrl key and press V.
METHOD 1 : Copy and Paste
(or)
Plug the USB flash drive directly into an available
USB port.

orders@surabooks.com PH: 9600175757 / 8124201000 / 8124301000


This is only for Sample Materials
for Full Book order online and available at all Leading Bookstores

326 Sura’s  XI Std - Computer Science - Govt. Model Question Paper 2018

5 x 5k iteration P P×a i i+1 ai


y= = Specification : x > 0
( −3)( −1) 3 0 1 0 0 20
1 2 1×2 1 0+1 21
find k such that k2 = x,
2 4 2×2 2 1+1 22
where k > 0 3 8 4×2 3 2+1 23

m
5 5x x 5k 5k
y = = 4 16 8×2 4 3+1 24
( −3( −
)(3−)(1)−1) 3 3
5 32 16 × 2 5 4+1 25
Alorithm Specification : To solove a problem,

co
first we must state the problem clearly and When the loop ends P = ai still true, but i = 5.
precisely. A problem is specified by the given input Therefore P = a5. In general when the loop ends,
and the disired output. to desing an algorithm for P = ab. Thus, we have verified that power ab
solving a problem we should know the properties satisfies its specification.

s.
of the given input and the properites of the 38. (i) In iteration, the loop body is repeatedly
desired output. The goal of the algorithm is to executed as long as the loop condition is
estabilshed the relation beltween the input and the true. Each time the loop body is executed,

ok
desired output in simple words, specification of an the variables are updated.
algorithm is the desired input-ouput relation. (ii) However, there is also a property of the
37. factorial (3) variables which remains unchanged by the
i = 1, f = 1;
=f=1×1
o execution of the loop body.
(iii) T his unchanging property is called the
=f=1×2
ab
loop invariant. Loop invariant is the key
=f=2×3
= f = 6. to construct and to reason about iterative
(or) algorithms.
Algorithm power (a,b) computes ab by multiplying
ur

a cumulatively b times. (or)


ab = a × a ×... × a
Power (a,n)
b times -- inputs n is an integer, n ≥ 0
.s

The specification and the loop invariant are shown -- outputs : an


as comments.
Power (a,b) if n = 0 -- base case
--inputs : b is a positive integer 1
w

---output : P = ab else
P, i:1,0 if (n%2! = 0) -- recursion step in case of odd
a × power (a, n -1)
w

While i ≠ b
else
-- loop invariant : P = ai
a × power (a, n/2) --- recursion step in case
P,i = P × a, i + 1
of even.
w

Each raw shows the values of the two variables p


and i at the end of an iteration, and how they are
calculated. we see that P = ai is true at start of the
loop, and remains true in each raw. Therefore, it is
a loop invariant.



orders@surabooks.com PH: 9600175757 / 8124201000 / 8124301000


This is only for Sample Materials
for Full Book order online and available at all Leading Bookstores

11 th SURA’s MODEL QUESTION PAPER -1


STD
Time Allowed : 2.30 hours COMPUTER SCIENCE Maximum Marks : 70

m
Section- I Codes:
(i) (ii) (iii) (iv)
(i) All questions are compulsory. (a) 4 1 3 2
(ii) Choose the most suitable answer from the given (b) 1 3 2 4

co
four alternative and write the option code and
(c) 3 1 4 2
the corresponding answer. (15 × 1 = 15)
(d) 4 3 1 2
1. Identify the output device ……………
7. Suppose u, v = 10, 5 before the assignment. What
(a) Keyboard (b) Memory

s.
are the values of u and v after the sequence of
(c) Monitor (d) Mouse
assignments?
2. Which refers to the number of bits processed by
a computer’s CPU? 1 u := v

ok
(a) Byte (b) Nibble 2 v := u
(c) Word length (d) Bit (a) u, v = 5 ,5 (b) u, v = 5 ,10
3. Which is the fastest memory? o (c) u, v = 10 ,5 (d) u, v = 10 ,10
(a) Hard disk (b) Main memory
8. Which of the following is not an invariant of the
(c) Cache memory (d) Blue-Ray disc assignment? m, n := m2+, n3+
ab
4. Pick the Odd one Out.
(a) m mod 2 (b) n mod 3
(a) UNIX (b) Linux
(c) 3 X m - 2 X n (d) 2 X m - 3 X n
(c) Android (d) Flowchart
9. Which one of the following is not correctly
ur

5. From the options given below, choose the matched?


operations managed by the operating system. (a) >> - Bitwise operator
(a) Memory (b) % - Arithmetic operator
.s

(b) Processes (c) && - Logical operator


(c) Disks and I/O devices (d) = - Ralation operator
(d) all of the above 10. Assertion (A) : A computer program is a set of
w

statements or instructions to perform a specific


6. task.
List I List II
Reason (R) : The action may be of variable
w

(i) Specification 1 hiding the details


declarations, expression evaluations, assignment
(ii) Abstraction 2 divide the main operations, decision making looping and so on.
algorithm into
(a) Both (A) and (R) are true and (R) is the correct
w

functions
explanation of (A).
(iii) Composition 3 relation between the
I/O (b) Both (A) and (R) are true and (R) is not the
(iv) Decomposition 4 algorithm consists correct explanation of (A).
of control flow (c) (A) is true, but (R) is false.
statements. (d) (A) is false, but (R) is true.
[327]

orders@surabooks.com PH: 9600175757 / 8124201000 / 8124301000

You might also like