Professional Documents
Culture Documents
2023
COMPUTER SCIENCE
CLASS-X
ØekeâeMekeâ :
Strictly based on latest (one paper)
examination pattern as adopted
by UPMSP, Prayagraj
27-Gulshan Vihar, Jansath Road,
Muzaffarnagar-251001 (U.P.)
Phone : 0131-2660440
e-mail : aviralpublications@gmail.com
time
Your faithful partner on way of success...
Dear Students,
is based on latest examination
pattern as adopted by UPMSP w.e.f. 2018-
19. Each chapter includes objective type,
very short answer type, short answer type
© Publisher and long answer type questions alongwith
5 unsolved test papers for practice
To check the level of preparation five
Pre-Board Online Question Papers will be
available on shribalajibooks.com before
Board Examination. Students may
download these papers time to time
scanning the QR code printed at the title.
Topics deleted for session 2022-23 due
to Covid-19, have been deleted.
We hope that will cater your
efkeâmeer Yeer $egefš kesâ efveJeejCe nsleg hee"keâeW kesâ megPeeJe meeoj needs and will ensure your grand success.
Deeceefv$ele nwQ~
efkeâmeer Yeer heefjJeeo kesâ efueS vÙeeefÙekeâ #es$e cegpeheäheâjveiej
nesiee~ — Publisher
Fme hegmlekeâ keâes $egefšjefnle ØekeâeefMele keâjves keâe hetCe&
ØeÙeeme efkeâÙee ieÙee nw, efheâj Yeer Ùeefo DeefveÛÚe mes FmeceW
keâesF& $egefš jn ieF& nes, lees Gmemes Glhevve efkeâmeer Yeer #eefle
kesâ efueS uesKekeâ, ØekeâeMekeâ leLee cegõkeâ keâe keâesF& oeefÙelJe
veneR nesiee~
Syllabus
Note : Topics under bold area have been deleted due to Covid-19 for 2022-23 Board Examinations.
Note: There will be a question paper of 70 marks in this subject to be solved in three hour.
PART-I
1. Computer and Communications 15 Marks
Communication Channel: Sender, Receiver, Media and Protocol, Types of Communication Channels,
Communication Media: WIRED and WIRELESS; Simplex and Full duplex, Networks: LAN and WAN Internet.
2. Linux Operating System 15 Marks
Advanced Function/ Features
Command Line Interface (CLI) and Graphic User Interface (GUI)
File Search and Text Search
Messaging Over LAN
Text Processing Command: CAT, GREP etc.
Vi Text Editor
Introduction to Linux Desktop
Security Management and its type in Linux.
3. Binary Arithmetics and Logic Gates 15 Marks
Bits, Nibble, Bytes Arithmetic: Word Length, Character Representation ASCII Characters Code, Simple Binary
Arithmetic: Addition, Subtraction, Multiplication and Division, Computer Logics, Boolean Operations, Logical
Operators: NOT, AND, OR, NOR, NAND and Truth Table.
PART-II
4. Advance Programming in ‘C’ 25 Marks
(a) Subscripted Variables (ARRAYS)
(i) Introduction
(ii) Single and Double Subscripted Variables
(iii) Searching and Sorting
(b) Arrays and Strings
(c) Functions and Subroutines, Library Function
(d) String Manipulations
String Functions: Direction to Switch between Numeric and String
Concatenation: To Add Characters in Word
(e) File Operation
Use of Sequential Files
Use of Random Files
Practical and Project Work 30 Marks
There will be Internal Examination of 30 marks on Computer Science for the session 2011-12.15 marks have
been allotted for Practical Work and 15 marks for Project Work.
Practical Work: Practical will done in different modules front chapter 2 and 4.15 marks have been allotted for
practical work. There will be Internal assessment of practical work at school level.
Project Work: Teachers are expected to have at least three projects from the prescribed list compulsorily
prepared by the students. The teachers may also ask the students preparing projects on same, other topics not
included in the prescribed list. There will be internal examination of project work at school.
Contents
1. Development of Computer, History and Introduction 5-8
3. Internet 18-21
Chapter Development of
Answers
1. (a) 2. (d) 3. (c) 4. (b) 5. (b) 6. (b) 7. (c) 8. (d)
Ans. On the basis of sizes computers are classified into four catagories:
(a) Micro computer (b) Mini computer (c) Main- frame computer (d) Super computer.
Q.6 Classify the computer on the basis of objective.
Ans. On the basis of objective computers are classified into two catagories:
(a) General objective computers and
(b) Specific objective computers.
COMPUTERS COMPUTERS
ON THE BASIS ON THE BASIS
OF INPUT OF SIZE
M.U.
Memory Unit
A.L.U.
Arithmetic
Input unit Output unit
Logic Unit
C.U.
Control Unit
(viii) Weather forecasting is another important activity which is easily available to us because of the use of
computers only.
(ix) In different scientific applications and researches computers have become a mandatory electronic device.
Q.2 Explain in details the classification of computers on the size and processing basis.
Ans. Classification of computers on the basis of size and processing speed :
(i) Micro Computers (ii) Mini Computers
(iii) Mainframes computers (iv) Super Computers
(i) Micro Computers : These are the smallest size of computers. They use microprocessor as their main
component in a computer system that’s why they named as micro computers. Now-a-days commonly used
computers belong the category of micro computers. Micro computers are also known as Personal Computers
(PCs). These are depending upon their size, and divided into following categories:
(a) Desktop PC
(b) Laptop PC
(ii) Mini Computers: These computers are bigger than microcomputers in size. The processing speed of these
computers is five times faster than microcomputers. They have bigger main memory of 250KB to 12MB and word
length of 12/32 bits. These minicomputers are multi-user in nature i. e. , more than one users can work on the
system at a time. They are designed for 4 to 8 users to work at a time. These systems are used in organisations,
business and commercial applications like banks and shopping complexes.
(iii) Mainframe Computers: These are very large computers with huge storage capacity and very high
processing speed. They allow 128 users to work at a time.
These systems are used in applications, which require networking and connectivity with multiple micro and mini
computers.
(iv) Super Computers: They are highly sophisticated computer systems. These systems use multiple
microprocessors and supports parallel processing at extremely faster rates. These systems are used in applications
in which very complex calculations are need to be done and in applications where time factor is a critical aspect.
These systems can perform 10 12 floating-point operations per second and with 100% accuracy rate.
qqq
9
Chapter
Answers
1. (d) 2. (a) 3. (b) 4. (c) 5. (a) 6. (d) 7. (c) 8. (c) 9. (d) 10. (d)
11. (d) 12. (b)
10
Ans.
Ring
Ring Topology
Modem
It changes the digital data from your computer into analog data, a format that can be carried by telephone lines. In
a similar manner, the computer receiving the data converts analog data to digital data through a modem. The
12
process of converting digital signals to analog is called modulation and analog to digital signal is called
demodulation.
Q.3 What is computer network ? (2013)
Ans. A computer network is a group of computer systems and other computing hardware devices that are linked
together communication channels to facilitate communication and resource-sharing among a wide range of
users. Networks are commonly categorized based on their characteristics.
Q.4 What is data transmission speed ? (2016)
Ans. In computer communication, the amount of data transferred from one place to another in one second is known as
data transmission speed. It is measured in bps (bits per second), kbps (kilo bytes per second), mbps, etc. There are
three communication channels on the basis of data transmission speed :
(i) Narrow band transmission—45 to 300 bps
(ii) Voice band transmission—upto 9600 bps
(iii) Broad band transmission— 10 6 bps or more
Q.5 Write a short note of network topology. (2012)
Ans. The term network topology refers to the way in which the nodes (computers or other devices that need to
communicate) of a network are linked together. It determines the data paths, which may be used between any
pair of nodes in the network. This would help to transmit data between them.
Q.6 Explain the ISO reference model. (2016)
Ans. An interconnected protocol for computer to computer communication as recommended by ISO (International
Standards Organisation) is receiving wide acceptance. It is an approach based on defining a number of distinct
layers each addressing itself to one aspect of linking. this is known as the ISO model for Open System
Interconnection. It is a seven layer architecture and defines a separate set of protocols for each layer.
Q.7 Differentiate between Protocol and Topology. (2014)
Ans.
Q.8 What are the types of communication ? Also write the applications of communication. (2016)
Ans. Communication basically are of two types :
(i) Oral communication
(ii) Written communication
(i) Oral Communication : In this type of communication, data or information is send in the oral form or we
can say that audio is use as message (data) to be transmitted over the channel. In oral communication we
use various method for transmission of data. Conversation between two person are the best of oral
communication.
Following are different form of oral communication are :
Telephone, Intercom, Mobile phone, Voice talk by computer, mail/chatting, etc.
(ii) Written communication : In this type of communication, data is send from one place to another in
written form which means if information in written form is send from one place to another then this type of
communication is called written communication.
Written communication is more important as well as efficient because there is always record of written
communication which send or receiver can use when ever they needed. This also act as important in
computer depended communication.
13
2. Frequency Modulation (FM) : In this type of modulation, message signal is superimposed on the carrier
wave in such a manner only frequency of this carrier signal varies accordance with instantaneous frequency
of the message signal while all other perimeter of carrier wave remain the same.
3. Phase Modulation (PM) : In this type of modulation, when message signal is superimposed on the
carrier signal then there a change in the phase angle of the carrier signal due to the message signal.
Q.11 Show the difference between LAN and WAN. (2014, 16)
Ans.
high-speed capabilities of the computer, this turn-around time is unacceptable in many instances. Also, some
applications require simultaneous transmission in both directions. In such case, a full duplex system is used,
which allows information to flow simultaneously in both directions on the transmission path. Use of a full
duplex line improves efficiency, because the line turn-around time required in a half duplex arrangement is
eliminated. It requires four wires.
Q.2 Draw a block diagram of communication system and label all the block. (2019)
Or
Draw a simple model of primary communication system and explain the functions of its block
in detail. (2010)
Ans. Block Diagram :
msg msg msg msg
Sender Encoding Channel Decoding Receiver
Feed back
only via the host computer. The routing function is performed by the host computer, which centrally controls
communication between any two other computer by establishing a logical path between them.
3. Ring Topology : In the circular or ring arrangement of a computer network, each computer has
communicating subordinates, but there is no master computer for controlling other computers. A node
receives data from one of its two adjacent nodes. The only decision a node has to take is whether the data is
for its own use. If it is addressed to it, it utilizes it. Otherwise, it merely passes it on to the next node.
4. Completely Connected Topology : A completely connected network has a separate physical link for
connecting each node to any other node. Hence, each computer of such a network has a direct dedicated
link, called a point-to-point link, with all other computers in the network. The control is distributed with
each computer deciding its communication priorities.
5. Tree Topology : It is also known as hierarchical or vertical network. There may be more than one central
nodes as it follows tree like architecture. If one center fails, the network can continue to be partially
operational. This kind of structure is used in remote access networks.
qqq
18
Chapter
3 Internet
Q.6 What is www ? What is a 'web-server' ? What are webpages? (2010, 16, 17)
Ans. www (World Wide Web) : It is a section of internet where related files are interlinked. This facility is similar to
magazine which consists of websites and webpages through which user can get the information about different
topics. www is a vast ocean of informations regarding almost every topic, place, country, etc. is available on it. In
fact the information about different topics and places is stored on bigger and efficient computers which provide
this, information to other connected computers. These computers with better efficiency are called
'web-servers'. Almost every country has its own web-server which stores the information about the country and
these servers are connected to each other to share their information and provide it to the other connected
computers.
The page on which information is written on www are called webpages. These webpages are designed by
skilled web-designers and then launched on it. The collection of webpages related to some place or topic is called
website. There are different types of sites available on it, e.g.,
.com — commercial sites
.edu — educational sites
.mil — military sites, etc.
.gov — government sites
.net — netwoking sites
There are several search engines available on Internet which work as interface between www and internet user
because they are helpful in searching the sites related to any content.
Q.7 What is main function of ISP?
Ans. The two main functions of ISP are given below :
(i) Provide a link : They provide a link to a company or individuals which enables them to access, www and
send Internet e-mail. They are entities that provide individual and institutional subscribers with access to
Internet.
(ii) Hosting : They host websites or publish a company’s website content to enable other companies or
consumers access to it, e.g., a person who is interested in launching a website will first obtain an account with
a hosting service provider and then will upload webpages onto his web site which is physically located on the
host’s ‘server’.
Q.8 What are the advantages of Internet? (2010, 12, 15)
Ans. Internet is an Information Highway and it has enormous advantages, few of them are listed below :
(i) Information can be transferred from a place to another place.
(ii) User can talk to a person sitting in any part of the world.
(iii) Lots of facilities available for entertainment viz. games, movies, online programs, etc.
(iv) User can do besiness on internet and this facility is called e-commerce.
(v) User can get information on any topic regarding education and can search the job too.
(vi) It is a great time and money saver. One can maintain his bank account through internet.
(vii) Billings and reservations can be done using internet.
(viii) News, live matches, concerts, etc. can be seen through internet.
Q.1 What is internet? What are its tools or applications? (2011, 12, 13, 16)
Or Write a short note on ‘Application of Internet’. (2016)
Or Describe Internet briefly. (2017)
Ans. Internet : Refer to short Answer type question no. 1
21
The worldwide scope of the Internet makes it perhaps, the single most valuable tool for use in many significant
ways by both non-profit and commercial organizations. Some of the important current strategic uses of the
Internet are listed below :
1. On-line communication : The electronic mail service on the Internet is extensively used today by
computer users around the world to communicate with each other. With this facility, the Internet has proved
to be a rapid and productive communication tool for millions of users.
2. Software sharing : The Internet provides access to a large number of shareware software development
tools and utilities. For example, a set of such shareware tools is available via ftp from the Internet site
sunsite.unc.edu. The Free Software Foundation also provides a wealth of GNU software tools on the Internet,
which that can be downloaded free of charge.
3. Exchange of views on topics of common interest : The Internet has a number of news groups. Each
news group allows a group of users to exchange their views on some topic of common interest.
4. Posting of information of general interest : The Internet is also being extensively used as a large
electronic bulletin board on which information of general interest can be posted to bring it to the attention of
interested users around the world. Some commonly posted information includes career opportunities,
conference and event announcements and calls for papers for conferences and journals.
5. Product promotion : Several commercial organizations are effectively using the Internet services for
promoting their products.
6. Feedback about products : Commercial organizations are also using the Internet to gather information
about user satisfaction of existing products, market opportunities of new products and ideas for potential
new products.
7. Customer Support Service : Many organizations are also using the Internet to provide timely customer
support. The combined electronic mail, ftp and other services on the Internet provide all of the enabling tools
necessary to provide such first-rate customer support.
8. On-line journals and magazines : The Internet now has literally thousands of electronic subscriptions,
which can be found both for free and low cost. Researchers are working in the direction to extend this idea to
support full-fledged electronic libraries on the Internet.
9. On-line shopping : The Internet has also facilitated the introduction of a new market concept, which
consists of virtual shops. These shops remain open 24 hours all the year round and are accessible to
purchasers all around the world. They provide information about products or services for sale through www
servers.
10. Worldwide video conferencing : Worldwide video conferencing is an emerging service on the Internet,
which allows a group of users located around the globe to talk and interact with each other as if they were
sitting and discussing in a single room. The parties interacting can see each other talking on their computer
screens and can hear each other’s voice through a special audio-device fixed in their computer.
qqq
22
Chapter
Answers
1. (d) 2. (c) 3. (c) 4. (b) 5. (c) 6. (a) 7. (d) 8. (c) 9. (d) 10. (b)
11. (b) 12. (c) 13. (b)
23
(v) In Linux, user can select any kind of text in Linux according to the need of the user in a given program.
Q.3 Write the drawbacks of Linux. (2016)
Ans. In Linux operating system, there are many important feature but it also have some limitation which are as follows:
(i) It is very difficult to work on this.
(ii) It is very difficult to install new software in Linux.
(iii) It is very difficult to connect new hardware because some other operating system such as DOS window
already have driver install in it but Linux does not have.
(iv) For using Linux must follow the instruction and remembered the syntax.
(v) This is case sensitive or we can say that small alphabet (a, b, c,...) and bigger (A, B, C,...) are both different for
Linux.
Q.4 Explain X-Windows in LINUX operating system. (2019)
Ans. X-Windows: Linux is the powerful framework for working with graphical applications and it is referred to as
X-windows system. X handles the function of opening X-based graphic user interface (GUI) applications and
displaying them on an X-server process. LINUX has an X-based Desktop environment to provide a desktop
metaphor and Windows manager to provide the GUI application like icons, window frames, menus and colours,
or a combination of these items called themes.
Q.5 Describe the directory. (2018)
Ans. In Linux structure, the upper most directory is called root directory. It does not have any name and is represented
by a symbol (/). Every directory is called the parent directory of all sub-directory made in it and these
sub-directory are called child directory. The directory in which we are doing work, these directory are called
current directory.
Q.6 What do you mean by Vi text editor in LINUX ? Describe it. (2008, 19)
Or
What is an ‘Editor’? Explain in detail the features in the context of Vi Text Editor. (2009)
Ans. Vi-text Editor: An editor is a utility program enabling the user to create (or modify) text files. The visual editor
or Vi-displays a window of text for edit operations. The Vi editor is used by the following command:
# vi filename
By defult, the Vi-editor will be open in command mode. The ESC key is used to switch over from command mode
to edit mode. The Vi editor has three modes: command, insert, and last line mode, firstly the Vi editor opens in
command mode, where you can move the cursor around, delete or append text: When you are in inert mode, you
can insert text. You cannot move cursor around while you are in insert mode. Whereas last line mode is for
commands beginning with;, as well as comm-and starting with/,? or !. Whenever you type a last line command,
your cursor moves to the last line of your screen.
Vi commands are case sensitive, the ‘a’ command is different from ‘A’ command.
Editing a New File: To create a new file, the syntax is: vi< filename> ¿
type i , start typing the text you want to insert. Do not press Return key after typing the i; only start typing your
input text.
Saving Your File: To save a file type: wq, when you type:, your cursor will move to the bottom of the screen. zz
is the alternate command to save but it is not safer than wr, zz is easier! Normally, you shouldn’t have problems
using zz.: q! is used to exit from Vi editor without saving.
Some of the most commonly Used Vi commands:
Command Meaning
<Esc> Used to return from command mode.
<Ret> Used to go to the first non-blank character of the next line.
<–> Go to the first non-blank character of the previous line.
<a> Used to append text after the cursor.
<A> Used to append text at the end of the current line.
<dd> Used to delete the current line.
25
Q.1 Describe the safety system, their features and their advantages in Linux. (2019)
Ans. Linux needs safety more, because Linux is made with the help of several distributions. Various program and
applications are added to it time to time, as a result linux needs more safety.
In Linux operating system with the help of checklist we provide security to our Linux system. This can be
understand by following terms:
26
1. To Change the Telnet Banner: When any user access it’s server through Telnet then he has to use Telnet. Due
to this, cracker will provide different important information related to your system. So, if you provide the user
with availability Telnet connection then it is important to change the Telnet banner yourself.
2. By disable ctrl + Alt+ Del: In default state, this service is available in maximum system and distributry, by the
console mode any with the help of three keys of keyboard can shut down the system. These keys are:
Ctrl + Alt + Delete
For security reason, this feature should be disabled.
3. By upgrading the Kernel: For establishing new Linux every time new Kernel (latest version) is used. And is
also remember as that only latest software should be downloaded.
4. Remove user Account: At the time of system installation undesired user account and group or default account
etc. should be removed.
5. Increase the login Level: Improvement should be made login level. For this, system should be configuration
in a such way that system could write.
6. By enable Net Filter: It is also known as I.P. Tables with the help of Netfilter provide filtering service to
Kernel— Label package, statefull and NAT. If the Linux— system is connected to firewall, then also user can use
the local network rules for traffic.
7. To disable by give take init: init is parent process in Linux. This can be used by given instruction to change
run-label of the operating system of the user. As user change run-label it will bring the system in
‘Single-user-mode’ which is a type of denial of service, i. e. , DOS. In opposite of this, services which are not secure
are enable for the other.
8. Remove History File: In every user account, one command should setup in Log-off search which will delete of
the history file after the user has logout. By doing this, if any undesired user some how enter in the command line
will not be able to check the work you have done or enable to see important information stored in the system.
9. To establish Vlock: It is an important service like ‘password protected screensaver’. This service is available at
terminal of Linux. This service can be used withoug logout in between the working session to login.
10. To establish Tripwere: This is an IDS file system and is used as very important tool in security.
11. Use CHROOT: It is used to prevent any service from working in any particular region. It is FTP (File Transfer
Protocol), here user is only able to see only root file from whole.
12. Use SYSLOGD: In Linux SYSLOGD is one of the important log-in tool. And it the first who point the undesired
user as they try to login.
13. To the Network Services: If any body want to give establish system security, then it is very important to
disable unwanted network services. By doing this, you reduce the number of option due to which load on system
management will also reduce. It is also very help while upgrading the system.
14. To establish Short: This is also IDS. It is very important in identification of attack done. It is used with the
firewall in the screen.
Advantages of Safety Arrangements in Linux:
(i) Linux has sufficient safety arrangements in it to stop an unauthorized user to work. Any user may access the
files only by inserting correct user name and password.
(ii) Specially firewall of Linux assures that any unauthorized user may not harm your files.
(iii) In linux, the identity of sender and receiver is assured at the time of exchange of e-mail messages.
Q.2 Write the name of various desktops available in Linux and explain any one of them. (2014)
Or
What do you mean by K-desktop environment? Explain its various components.
Ans. As you login Linux operating system it’s desktop can be seen on the computer screen. On desktop, there is stripe at
bottom of the desktop which we called pannel on this there is icon, button and menu, etc. of the program on the
right of pannel, there is a clock which show present time.
Most popular GUI interface of the Linux operating system is as follow:
(i) K-Desktop Environment
27
qqq
28
Discrete
Chapter Mathematics
5
[Character Representation,
Binary Arithmetic and
Logic Operations ]
Answers
1. (a) 2. (c) 3. (d) 4. (b) 5. (b) 6. (d) 7. (c) 8. (c) 9. (a) 10. (c)
11. (c) 12. (b)
A
Ans. Y
B(suppose)
Y = (A ¢)B + A ¢B ¢ = AB + AB = A B
Q.11 Draw the symbol of OR Gate.
A
Ans. R
B
OR gate
Q.12 If A = 0 and B = 1, then find the value of Y from the following expression:
Y = (A × B)
Ans. Y = (0 .1)
Y =0 =1
Q.13 Differentiate between Nibble and Byte. (2013)
Ans. Nibble: Group of 4 bit is called nibble or 4 bits make 1 nibble.
Byte: Group of 8 bit is called Byte or 8 Bits or 2 nibble make 1 byte.
1 byte=8 bits= 2 nibble
Q.14 |110000|2 - |100010|2 = | ?|2 (2019)
Ans. 110000
-100010
001110
|110000|2 - |100010|2 = |001110|2
30
0+0 0 0
0+1 1 0
1+0 1 0
1+1 0 1
Example: 1101011
+ 001001
1110100
Q.4 Explain truth table. (2016)
Ans. Truth table list all possible combination of input binary variable, to produce the corresponding output of a logical
system. A truth table contain many row and column which depend on the boolean variables.
For example: If in an expression, there are two Boolean variable then truth table will have total possibilities
( 2 ´ 2 = 4 rows).
X Y ¬ Variable
0 0 ü
0 1 ï
ï
ý Truth value
1 0 ï
1 1 ïþ
Q.6 Which are universal gate and why are they called universal gate? (2017, 18)
Ans. Such gates by using those only any circuit design can be made, are called universal gates. NAND and NOR gates
are such gates. NAND and NOR gates can give output equivalent to AND, OR and NOT gates, so they are called
universal gates.
Q.7 What do you mean by character representation ? (2016, 18)
Ans. Character Representation:We know computer perform it’s each function in binary form before storing any
kind of data is first converted into binary form then it is stored. For converting data into binary data different kind
of computer code are used which convert the data into binary form. Following are popular code used for this
purpose.
1. Binary Coded Decimal Code (BCD): In this process each character is assigned in decimal number.
2. Extended Binary Coded Decimal Interchange Code (EBCDIC): It is also called 8 bit BCD code.
3. American Standard Code for Information Interchange Code (ASCII): In this process code is
predecided for character, digit and sign.
Q.8 Prove that AB + AC + BC = AB + AC (2017)
Ans. AB + AC + BC = AC + AB + AC + BC × 1
= AC + AB + BC(A + A) (From complement law)
= AC + AB + ABC + ABC (From distributive law)
= AC + ABC + AB + ABC (From commutative law)
= AC(1 + B) + AB(1 + C) (From distributive law)
= AC × 1 + AB × 1 (From the property of 1)
= AC + AB Proved.
Q.9 Prove in Boolean algebra AB + A + AB = 0 (2019)
Ans. AB + A + AB = 0
= (AB) × A × AB (From Demorgan law)
= AB × A × AB (From envulation law)
= AB × AB × A (From commutative law)
=0×A (From complement law)
= 0 Proved. (From the property of 0 )
Q.10 Draw Logic Figure of the given logic equation and write its truth table. (2019)
Y = (A + B)(B + C)(A + C)
Ans. Logic Diagram:
A (A+B)
B
(B+C)
Y
C
(A+C)
Truth Table
A B C (A+B) (B+C) (A+C) Y=(A+B) (B+C) (A+C)
0 0 0 0 0 0 0
0 0 1 0 1 1 0
0 1 0 1 1 0 0
32
0 1 1 1 1 1 1
1 0 0 1 0 1 0
1 0 1 1 1 1 1
1 1 0 1 1 1 1
1 1 1 1 1 1 1
x y x¢ y¢ x+y (x + y) ¢ x¢ × y ¢
0 0 1 1 0 1 1
0 1 1 0 1 0 0
1 0 0 1 1 0 0
1 1 0 0 1 0 0
From the above truth table, it is clear that both sides of theorem are equal, Hence, the theorem is proved.
33
x y x¢ y¢ x×y (x × y) ¢ x¢ × y ¢
0 0 1 1 0 1 1
0 1 1 0 0 1 1
1 0 0 1 0 1 1
1 1 0 0 1 0 0
From the truth table, it is clear that both sides of theorem are equal. Hence, the theorem is proved.
Theorems (a) and (b) are very important and useful. They are known as De Morgan’s theorems. They can be
extended to n variables as given below:
(x 1 + x 2 + x 3 + .....+ x n )¢ = x 1¢ × x ¢2 × x ¢3 ......... x ¢n
(x 1 × x 2 × x 3 × ..... x n )¢ = x 1¢ + x ¢2 + x ¢3 +.........+x ¢n
Q.2 Write AND Laws, OR laws and NOT Laws (2017)
Or
Explain the working procedure of NOT and OR gate and also write their truth table. (2011)
Or
Explain the working procedure of NOR and NAND gate. Also explain their uses and truth tables.
(2010, 11, 12)
Or
By drawing logic symbol of NAND and NOR gate, write their truth table. (2019)
Ans. AND Gate
An AND gate is the physical realization of the logical multiplication
(AND) operation. It is an electronic circuit which generates an output
Input A B Output
signal of 1, only if all input signals are also 1.
To have a conceptual idea, let us consider the case of Figure. Here, two Two or more switches connected in
switches A and B are connected in series. It is obvious that the input series behave as an AND gate
current will reach the output point, only when both the switches are in
the on(1) state. There, will be no output (output = 0), if either one or both the switches are in the off (0) state.
Hence, two or more switches connected in series behave as an AND gate.
A
C=A· B
B
Inputs Output
A B C = A×B
0 0 0
0 1 0
1 0 0
1 1 1
OR Gate
An OR gate is the physical realization of the logical addition (OR)
operation. It is an electronic circuit, which generates an output A
signal of 1, if any of the input signals is also 1.
Two or more switches connected in parallel behave as an OR gate. Input Output
It can be seen from Figure, that the input current will reach the
output point, when any one of the two switches are in the on(1)
B
state. There will be no output, only when both the switches (A and
Two or more switches connected in parallel
B) are in the off (0) state.
behave as an OR gate
The truth table and the block diagram symbol for an OR gate, for
two input signals, are shown in Figure below. Observe that, an
output of 1 is obtained, when any of the input signals is 1. It is 0, only when both the inputs are 0.
A
C =A+ B
B
Inputs Output
A B C=A+B
0 0 0
0 1 1
1 0 1
1 1 1
A A
(a)
Input Output
A A
0 1
1 0
A
A A=A
(b)
(a) Block diagram symbol and truth table for NOT gate, and
(b) Two NOT gates in series
35
NAND Gate
A NAND gate is a complemented AND gate. That is the output of NAND gate will be a 1, if any one of the inputs is a
0 and will be a 0, only when all the inputs are 1.
The truth table and the block diagram symbol for a NAND gate are shown in Figure. The symbol ‘ ’ is usually
used to represent a NAND operation in Boolean expressions. Hence, A B = A × B = A + B .
A
C = A B = A·B = A + B
B
Inputs Output
A B C=A+B
0 0 1
0 1 1
1 0 1
1 1 0
A A·B
A·B = A + B = A B
B
NAND gate realization with an AND gate and a NOT gate
NOR Gate
A NOR gate is a complemented OR gate. That is the output of a NOR gate will be a 1, only when all inputs are 0
and it will be a 0, if any input is a 1.
The truth table and the block diagram symbol for a NOR gate are shown in Figure. The symbol ‘¯’ is usually used
to represent a NOR operation in Boolean expressions. Hence, A ¯ B = A + B = A × B .
A
C=A¯B=A+B=A· B
B
Inputs Output
A B C = A ×B
0 0 1
0 1 0
1 0 0
1 1 0
A A+B
A+B=A·B=A¯B
B
NOR gate realization with an OR gate and a NOT gate
qqq
36
Chapter
6
Introduction to ‘C’ : Array
Searching and Sorting
Answers
1. (a) 2. (c) 3. (b) 4. (d) 5. (c) 6. (a) 7. (a) 8. (b)
(iv) The fourth generation or 4GL is easy for user and helps to make new application programes. This
generation language is used in database and scripting programing.
(v) The fifth generation or 5GL are programing language that contain visual tools to help develop a programe
e. g. , OPS5 and prolog.
Q.1 What is array? What are its types? Write a programe in C language by using array which
calculates average value of 50 whole numbers placed in array. (2019)
Or
What is array? Explain one dimensional and two dimensional array with examples. (2016, 17)
Ans. A single array is the group of same type of data, which could be represented by same name-important thing in this
is that data stored in array are of same type as well as same size. In the array, every element is stored in it with the
help of subscript which written in [ ] after name of Array. This is also called index variable or we can say each
element stored in array is self contained.
Array are of two types :
(a) One-dimensional Array
(b) Two-dimensional Array
(a) One-dimensional Array : One-dimensional or single dimensional have only one subscript. Subscript is
written between the [ ] which is after the array name. Element of an array is like a variable or we can say that
which can only represented by an unique subscript.
Let us understand this with the help of a example, how it is declared and it’s syntax.
Syntax :
< Type of an Array > < Name of an Array > [Element/size];
For example :
int arr [5];
char name [10];
means
arr =
[0] [1] [2] [3] [4]
name =
[0] [1] [2] [3] [4] [5] [6] [7] [8] [9]
Here arr[5] means 1-dimensional array of int type, which will store integer value or we can say every element of
array such as arr [0], arr [1], arr [2], etc. will only be represent by one subscript such as 0, 1, 2, etc. In this way
arr[ ] is a 1-dimensional type of array.
Char name [10] means name is char type of 1-dimensional array which is the group of 10 characters or 10
characters are stored.
Means char name [10] = “ALLAHABAD”
A L L A H A B A D ‘\0’
[0] [1] [2] [3] [4] [5] [6] [7] [8] [9]
As we known, one int variable take 2 Byte space. So array of 5 element need 10 byte (2 × 5 = 10) space. In the
same way, 1 char variable take 1 byte space which means Array of 8 element need 8 byte space.
(b) Two-dimensional Array: Like one-dimensional array which has only one subscript,in the same way,
two-dimensional Array have two subscript.This also called as Matrix. As in a matrix, every element is pointed by
39
it’s row as well as column, in the same way, for pointing the element two subscript are used in which first subscript
is called row while second subscript is called column.
For example :
First column Second Third column
column
[0] [1] [2]
First row [0] [0] [0] [0] [1] [0] [2]
Second row [1] [1] [0] [1] [1] [1] [2]
Third row [2] [2] [0] [2] [1] [2] [2]
Initialization of Two-dimensional Array : Initial value can be given to the two-dimensional array only at
the time of declaration. Initial value to this array can be given as follows :
Syntax :
<Type of Array> <Name of Array> [No. of row] [No. of column] = [Value 1, Value 2...]
OR <Type of Array> <Name of Array> [No. of row] [No. of column]
= {{Value of first row} {Value of second row}};
For example :
int num [2] [2] = {6, 18, 23, 30};
OR int num [2] [2] = {{6, 18}, {23, 30}};
In the above example, int num [2] [2] = {6, 18, 23, 30}; first value written between { }, i.e., (6) will be the first
element or it will stored at num [0] [0]. And in the same way 18, 23 and 30 are stored in continuous order(way).
If the address of num [0] [0] is 1048 in memory then,
40
Programe in C language which calculates average value of 50 whole numbers placed in an array.
#include<stdio.h>
#include<conio.h>
void main ( )
{
int n = 50, i, a [50], sum = 0, avg;
clrscr ( );
printf (“Enter the 50 whole numbers”);
for (i = 0; i<n; i++)
{
scanf (“%d”, &a[i]);
}
for (i = 0; i<n; i++)
{
sum = sum + a [i];
}
avg = sum/n;
printf (“%d”, avg);
getch ( );
}
Q.2 Explain searching, sorting and merging and give example of each. (2019)
Or
What is searching and sorting? Explain their technique available in C language. (2018)
Ans. Searching : Searching means find or select. To find some text or written information or group of data according
to the need of the user in programming language is called searching.
Example: The given program searches the number chose by sequential search out of a positive whole number test
list.
Program: This can be explained by following example :
#include <stdio.h>
main ( )
{
int num [50], n, i;
int temp, flag = 0;
printf ("Enter the size of the list :\n");
scanf ("%d", &n);
printf ("Enter the integer number :\n");
for (i = 0; i< n; i++)
{
scanf("%d", & num [i]);
printf ("Enter the number search for :")
scanf ("%d", temp)
41
Merging: The procedure, to add two array with third array, is known as merging.
Program:
#include<stdio.h>
#include<conio.h>
void main ( )
{
int a[50], b[50], c[50], i, k, sizel, size2, size3;
clrscr ( );
printf (“Enter the size of first array”);
scanf (“%d”, &sizel);
printf (“Enter the elements of first array \n”);
for (i=0; i<size1; i++)
{
scanf (“%d”, &a[i]);
}
printf (“Enter the size of second array”);
scanf (“%d”, &size2);
printf (“Enter the elements of second array \n”);
for (i=0; i<size2; i++)
{
scanf(“%d”, &b[i]);
}
printf (“Elements of third array after merge \t”);
for (i=0; i<size1; i++)
{
c[i]=a[i];
}
size3 = size1 + size2;
for (i=0, k=size1; k<size3 && i<size2; i++, k++)
{
c[k]=b[i];
}
for (i=0; i<size3; i++)
{
printf (“%d\t”, c[i]);
}
getch ( );
}
qqq
43
Chapter
7 String in ‘C’
Answers
1. (a) 2. (c) 3. (a) 4. (b) 5. (b) 6. (a) 7. (b)
(viii) Strupr( ) : This function is opposit of strlwr function as it is used to convert lower case (a to z) to upper case (A to
Z).
Q.1 Write name and uses of four functions used on strings. (2011, 12)
Ans. Following are the four functions used on string :
1. strcat( )
2. strcpy( )
3. strcmp( )
4. strlen( )
1. Strcat( ) Function : With the help of the function two different string can be connected with each other which mean
this function take first string and connect (join) second string at the end of the first string. Process of connecting two string is
called concatenation.
Syntax :
strcat (str1, str2)
OR
strcat (to, from);
Example :
.......................
char str1[20] = "BALAJI";
char str2 [20] = "PUBLICATION";
str (str1, str2);
puts (str1);
Result : BALAJI PUBLICATION
Example : To connect two string given by the user.
#include <stdio.h>
#include <conio.h>
#include <string.h>
main( )
{
char str1 [20], str2 [20];
clrscr;
printf("Enter the first string\n");
gets (str1);
printf("Enter the second string");
gets (str2)
strcat (str1, str2);
printf(string after concatenation : %s", str 1);
}
2. Strcpy( ) Function : With the help of this function we can copy on string into the another string or we can say that
this can copy first string in place of second string.
Syntax :
strcpy (str1, str2);
OR
strcpy (to, from);
....................
char str1 [30] = "It is Wednesday today";
char str2 [30] ="It is Thursday today";
....................
strcpy (str2, str1);
puts(str2);
Result : It is Wednesday today.
Example : To copy first string into the second string enter by the user.
46
#include <stdio.h>
#include <string.h>
#include <conio.h>
void main ()
{
clrscr( );
char str1 [30], str2 [30];
printf("Enter the first string");
gets(str1);
strcpy (str2, str1);
printf("After coping first string is: %s", str2);
}
3. Strcmp ( ) Function : With the help of this string function we can compare two string. If both string is same than it
provide ‘O’ else if both are different then both string are compared not on the bases of length but on the bases of element
stored.
Syntax :
strcmp (str1, str2);
char str1 [20] = "ABCD";
flag = strcmp (str1, "BCDE");
Here, value of flag will be less than 0.
flag = strcmp ("India", "india");
Here, value of flag will be 0.
Example : Write a program, to compare two given string by the user.
#include <stdio.h>
#include <string.h>
main ( )
{
char str1 [25], str2 [25];
printf ("Enter the first string\n");
gets (str1);
printf ("Enter the second string\n");
gets (str2);
if (strcmp (str1, str2) = = 0)
printf ("Strings are equal\n");
else
printf ("Strings are not equal\n");
}
Result :
Enter the first string
Sharanya
Enter the second string
Ananya
Strings are not equal
4. strlen( ) Function : With the help of this function we determine the length of strings or number of element present in
the string.
Syntax :
strlen (string);
...............
char name [25] = "BALAJI PUBLICATION"
n = strlen (name);
Result : 19 (19 will print on screen)
Example : Write a program, to determine the length of string input by user.
#include <stdio.h>
#include <string.h>
47
void main ( )
{
char city [20];
int num;
printf ("Enter the string or city name;\n");
gets (city);
num = strlen (city);
printf ("The length of city is : %d", num);
}
Example :
main( )
{
char name [25];
printf ("Enter your name\n");
gets (name);
printf ("The length of name is = %d", strlen (name));
}
qqq
48
Chapter
8 Function in ‘C’
Answers
1. (c) 2. (b) 3. (a) 4. (d) 5. (a) 6. (a)
else
return (x *fact (x-1));
}
Result : Enter any number = 5
5! = 120
Q.1 What are numeric functions in ‘C’ language? Explain any four. (2017)
Or
What are library functions? Write their uses with examples. (2010, 14, 16)
Or
Describe necessities of user defined functions and their uses with examples. (2019)
Or
What are user defined functions? What factors should be keep in mind in such functions?
Ans. Function is a part of main program and generally used for calculations of main program. There are following two
types of functions in ‘C’ language :
(i) Buil-in-function or Library function and (ii) User defined function
(1) Buil-in-function (or Library function)
These are such functions, which participate mainly in ‘C’ language. These are recognized with their names and
used. We provide essential information with these functions in the form of parameters.
Different types of library functions are given below:
(i) Arithmatic function: Such type of functions are used for arithmatic operations.
Þ abs ( ): Prototype < math.h> of this function is available in header file. This function is used for returning the
absolute value of a number.
Þ sin ( ): Prototype <math.h> of this function is available in header file. This function is used for returning the
values of sin of given angle in radian.
Example: #include<stdio.h>
#include<math.h>
void main ( )
{
double a, b, angle;
printf (“Enter the Angle in radians:”);
scanf (“%1f ”, &angle);
a = (3.14/180)*angle;
b = sin (a);
printf (“Sine value of %1f is %1f ”, angle, b);
}
Output: Enter the Angle in radians : 60
Sine value of 60.000000 is 0.865760
Þ exp ( ): Prototype <math.h> of this function is available in header file. This function is used to determine the
exponential of a number.
Þ sqrt ( ): Prototype <math.h> of this function is available in header file. This function is used to find square
root of a number.
(ii) String function: Such functions are used on strings.
51
Þ strlwr ( ): Prototype <string.h> of this function is available in header file. This function is used to change
small letters of alphabat.
Þ strcmp ( ): Prototype <string.h> of this function is available in header file. This function is used to compare
two strings.
Þ strcat ( ): Prototype <string.h> of this function is available in header file. This function is used to add two
strings.
(iii) Character function: Such functions are used on characters.
Þ isupper (c): Prototype <ctype.h> of this function is available in header file. This function ensures true
return, if character (c) is capital letter of alphabat.
Example: #include<stdio.h>
#include<ctype.h>
void main ( )
{
char s;
printf (“Enter the string”);
scanf (“%c ”, &s);
if (isupper (s))
printf (“This is in upper case”);
else
printf (“This is not in upper case”);
}
Output: Enter the string g
This is not in upper case
Enter the string G
This is in upper case
Þ isdigit (c): Prototype <ctype.h> of this function is available in header file. This function ensures true return if
character (c) is a number.
Þ tolower ( ): Prototype <ctype.h> of this function is available in header file. This function converts character
(c) into small letters of alphabat.
(2) User defined functions
These functions are written according to the requirement of the user e. g. , Main () function.
We have to consider the following three elements while using this function :
(i) To define functions :
Syntax : function_type function_name (parameter list)
{
local variable declaration;
executable statement1;
executable statement2;
…
return statement;
}
Example: int add (int x, int y)
{
int a;
a = x+y;
return (a);
}
52
Parameters (or arguments) are separated by their data type by applying comma.
(ii) To call the function: A function may be call in a program by only giving its name and by putting its actual
parameter or list of argument (if any) in a bracket.
Syntax: function_name (parameter list);
Example: To call the function add ( ) defined above.
Main ( )
{
int s;
s = add (4, 5);
printf (“%d”, s);
}
(iii) To declare the function: All functions used in a ‘C’ program are declared before their usage (like variables).
Syntax: function_type function_name (parameter list);
Example: int add (int, int);
qqq
53
Chapter
Q.1 Which of the followings function is appropriate function to close the file ? (2016)
(a) CLOSE (b) END (c) EOF (d) FILE END
Q.2 Which of the followings command is used to read character in a file ?
(a) putc( ) (b) getw( ) (c) getc( ) (d) putw( )
Q.3 Which of the followings command is used to set the file pointer in the file initially ?
(a) ftell( ) (b) fseek( ) (c) rewind( ) (d) feof( )
Q.4 Which function sets the file pointer associated with a strem to a new position ?
(a) fseek( ) (b) perror (c) rename (d) rewind
Q.5 Syntax of command getw is :
(a) getw (FILE *filepointer); (b) getw (FILE)
(c) getw (*filepointer); (d) int getw (FILE *filepointer);
Answers
1. (a) 2. (c) 3. (c) 4. (a) 5. (a)
Q.1 Explain the file in ‘C’ language and write its type. Explain the main functions of ‘C’ language to
read data. (2013, 19)
Or
Explain the input/output operations in a file. (2016)
Or
What do you mean by file operation in ‘C’ language? (2016)
Or
Explain the following functions : (2019)
(i) fseek ( ) (ii) rewind ( ) (iii) feof ( )
Ans. File : A file is such a place on a disc where a group of related data is stored. This data storage is unstable.
Types of file : There are two types of files :
(1) Program file : Programs written in a programing language are stored in the files, these files are known as
program files.
(2) Data file : The files in which data, used for input/output programs, is stored are known as data files. These
files are categorised in several categories. Following two are main types :
(i) Sequential data files : Refer to Q. 3 (Short Answer Type Questions)
(ii) Random data files : Refer to Q. 1 (Short Answer Type Questions)
Define a file : Data structure of file is defined in the form of FILE in the library of definitions of standard input/
output functions. It is an already defined data type. General for to declare a file is as follows :
FILE * afile;
Here variable afile is a pointer for data type FILE
Various file operation : These are the functions, by which we can open the disc file, we can add or subtract
and close the file. For any type of operation, first of all we have to open the file.
For this first of all we have to declare the file. Several operations are as follows :
(a) fopen ( ) command : It is used to make a new file or to open or start a file in memory. Here file can be open
in several mode, e. g. ,
r (read) mode
r+ (read/write) mode
w (write) mode etc.
syntax : fopen (“filename”, “mode”);
(b) fclose ( ) command : It is used to close an opened file. By using this command a user can close more than
one files simultaneously.
syntax : fclose (FILE * filepointer);
(c) getc ( ) command : It is used to read a character from a file.
syntax : getc (FILE * filepointer);
(d) putc ( ) command : It is used to write a character in a file.
syntax : putc (character, FILE * filepointer);
(e) fgetc ( ) command : It is used to read a character from the file.
syntax : int fgetc (FILE * filepointer);
(f) fprintf ( ) command : It is used to write the value of data in a file.
syntax : fprintf (FILE * filepointer, constant char *format_string);
56
qqq
57
Chapter
10
Programs Based on ‘C’
Language
Q.2 To find and print the prime numbers from 1 to 100. (2010)
Ans. #include <stdio.h>
#include <conio.h>
main ()
{
int n,i,j;
float r;
for (i=1; i<=n;i++)
{
for (j=2;j<=i/2;j++)
{
R=i%j;
if(r = =0)
}
break;
}
}
if (r!=0)
58
}
Printf ("\n%d",i)
}
getch( );
}
Output 1 3 5 7 11 13 17 19 23 29 31 37 41 43 47 ........
found = 0;
printf("Enter an integer\n");
scanf("%d", &num);
temp=num;
while (num > 0)
{
digit=num%10;
rev=rev*10+digit;
num/=10;
}
Printf("Given number is =%d\n", temp);
if (temp = = rev)
Printf("Number is palindrome\n");
else
Printf ("Number is not palindrome\n");
getch( );
}
Output Enter an integer
1 2 3 2 1
Number is palindrome
If (found= = 1)
printf("Number is find Successfully!\n");
else
printf("Number is not found!\n");
getch( );
}
Output Enter the value of N
5
Enter the elements one by one
56
32
85
12
35
Enter the number to be searched
85
Number is find Successfully!
array[j+1] = temp;
}
}
}
Printf ("Sorted array is \n");
for (i=0; i<=n; i++)
{
printf("%d\n", array[i]);
}
getch( );
}
Output Enter the value of n
6
Enter the elements of an array
30
23
18
26
87
34
The stored array is ........
18
23
26
30
34
87
printf("%d", rev_num[j]);
}
Output Enter the number (not more than 20):
5
Enter 5 integer numbers :
5 6 7 8 9
Reversed numbers are :
9 8 7 6 5
Q.18 Write a program in 'C' language which input 20 numbers and print them in descending order.
(2016)
Ans. #include<stdio.h>
void main ( )
{
int num [30], s, i, j, temp;
printf ("Enter the size of the list : ") ;
scanf ("%d", &s) ;
printf ("Enter the positive numbers upto size:in") ;
for (i=0; i<s; i++)
70
46
46
45
44
27
23
23
22
13
13
12
10
7
Q.19 Write a program in ‘C’ language which may searh that specific data is available or not in a
string.
(2016)
Ans. #include<stdio.h>
void main ( )
{
char c [1000], ch;
int i, count=0;
printf ("Enter a string: ");
gets (c);
printf ("Enter a character to find frequency: ");
scanf ("%c", &ch);
for (i=0; c[i] !='\0' ;++i)
{
if (ch==c[i])
++count;
}
printf {"Frequency of %c = %d", ch, count) ;
}
Output
Enter a string : Program
Enter a character to find frequency : g
Frequency of g = 1
Q.20 Write a program in ‘C’ language, which may print in the form of an array in ascending order by
being input of 10 digits. (2016)
Ans. #include<stdio.h>
void main ( )
{
int num [100], s, i, j, temp;
printf ("Enter the size of the list:");
scanf ("%d", &s) ;
printf ("Enter the positive numbers upto size : in") ;
for (i=0; i<s; i++)
72
void main ()
{
int i, j, marks, sum = 0;
float avg;
char name [30];
clrscr ();
for (i=1 ; i<20; i++)
{
printf (" Enter the student name\t");
scanf ("%s", name);
sum = 0 ;
printf ("\n Enter subject marks of %s", name);
for (j=1, j<=4, j++)
{
scanf ("%d", &marks);
sum = sum+marks;
avg = sum/4;
}
printf ("Average marks = % f\n", avg);
}
getch ();
}
qqq
76
Project Work
PROJECT WORK - 1
What is communication media? What are it’s various types? Explain it’s advantage and uses?
General Introduction : Early the information or message are send by writing on paper and send them from one
place to another by somebody. As science develop, the human develop many new and fast method for transmission of
information. By this means of communication we meant different technique used for giving/taking information/data.
To send data/information from one end to another we always need communication medium or in other word we can
say that to transmit data from sender to the receiver we need communication medium which we called communication
channel.
Communication media is that path which use electrical and electromagnetic wave to send data/information.
In computer, the work of give and take of network signal is done by communication medium. This is of different type
which you can understand by following figure.
Twisted pair
FM Radio & TV
Telephone service
AM Radio
Microwave
Optical fibre
Satellite
Radio
Microwave Infrared Ultra violet
Capacity of any network depend on communication medium.
(a) Twisted pair Cable : A twisted-pair were consist of two bunches of thin copper
wire, each bunch enclosed separately in a plastic insulation, then twisted around
each other to reduce interference by adjacent were as shown is figure. It is also
called unshielded twisted pair (UTP) cable because other than the plastic coating
around the two individual bunches of copper wire they are normally used to
connect terminals to the main computer, if they are placed at short distance from
the main computer data transmission speed of up to 9600 bits per second can be
achieved. The thickness of these cable is 0.016 to 0.036 inch.
Use : It is used in telephone, intercom, etc. Twisted pair Cable
(b) Co-axial Cable : Co-axial cable are groups of specially wrapped and
insulated were line, which are able to transmit data at high rates.
As shown in figure, they consists of control copper wire surrounded by a PVC
insulator over which a sleeve of a copper mesh is placed the metal sleeve is
again shield by an outer shield of thick PVC material. The signal is transmitted
by the inner copper wire and is electrically shield by the outer metal sleeve.
Co-axial cables offer much higher bandwidth the UTP cables, and are capable
of transmitting digital signal at rates of 10 mega bits per second.They are
extensively used in long distance telephone lines and as cables for cable T.V. It
is also used for LAN etc. Co-axial Cable
(c) Optical Fiber Cable : It is the most advance media used for transmission
of data. And this is also used for maximum internet services.
It is very flexible and thin and used light signal for transmission of data or it
convert electromagnetic signal into light signal then transmit it. Optical
fibers are hair-thin threads of glass or plastic which has thousand in number.
Bundle of this optical fibers are covered with plastic.
Use of Optical Cable : Internet services use optical fiber for it’s work. Data
speed in optical fiber is in few GB per second.
2. Wireless Communication : In this system of transmission is not done
through wire but we use wave for message (or data) transmission. Following are the Optical Fibre Cable
wave which are used for this purpose :
(a) Radio wave : These are those electro-magnetic which has frequency in between 3KHz to 16Hz. By radio wave
data is transfer through air or sky with the help of Antenna. In this, transmitting antenna transmit signal in air in
all the direction which can be receive by any other antenna. Radio wave are of the following category.
(i) Short wave radio
(ii) Very high frequency (Use in T.V. and FM etc.)
(b) Microwave : Microwave are basically electromagnetic waves have frequency between 1 to 300 GHz. It is a
line-of-sight propagation. As matter of fact, the microwave band is wide (299 GHz) and so it is possible to allot
wides band.
Microwave communication are of two types :
(i) Terrestrial Microwave
(ii) Artificial Satellite Microwave
78
PROJECT WORK - 2
What is an function? Explain it’s main type with suitable example?
Function : Function is independent or self contained group of statement which is made to perform a particular type
of function (or work). When a bigger program is break into smaller program and is executed according to the main
program, these small sub-program are called the function.
If a statement is repeated several times in the program, then it is written in any function and use it, there is no need
to write it again and again. By dividing the bigger program into small function it makes program easy to understand
simple to execute.
For example :
main ( )
{
GOPALA ( );
printf ("\n Don’t be silly.");
{
Gopala ( )
79
{
printf ("\n it’s my pleasure");
}
Types of Function
Function in C-language are of two types :
Function
Built-in-library User-defined
function function
Built in library Function : These function which are pre-define or we can say that those function in C-language is
already described. User can use these function directly in program. These function are prepared by various hader file.
(a) Stdio.h : This header file contain standard input/output functions prototype.
For example :
printf ( ) Scanf ( ) putc ( ) getc ( )
putchar ( ) getchar ( ) puts ( ) gets ( )
(b) String.h : This header file contain the prototype of functions related to the strong.
For example :
strlen ( ) strcpy( ) strcat () strcrop ( )
(c) conio.h : This header file contain prototype of function related to screen.
clrscr ( ) getch ( )
(d) Math.h : This header file store the prototype of function related mathematical operation and it’s definition.
For example :
squrt ( ) cos ( ) sin ( )
pow ( ) log ( ) abs ( )
(e) ctype.h : This header file contain the prototype of the function related to manipulation of character.
For example :
tolower ( ) toupper ( ) isupper ( )
Some use of built in library function of ‘C’ Language
(1) Input/output Function : This function is use to give input and take output. These are as follows :
(a) printf( ) : This function is used to print any work, sentence, character, symbol etc; as it is on screen.
For example : #include <stdio.h>
main( )
{
printf("we are Indian");
}
80
Syntax :
<type> <Function-name> (Parameters/Argument)
{
...................
...................
}
In above syntax,
<Type> It show the type of return value after function is executed.
<Function-name> This is used in the user function at the time of call the function.
(Parameter/Arguments) These are those variable parameters which is send by calling function on which function
can work.
Value between { } (curly braces) is called function body.
Important facts Regarding function :
• Every function should have a unique name by which it can be identified.
• Function is made to fulfil (or complete) any particular work or function.
• Both function and variable will follow the rules given by identifier.
• For declaration of any function, semicolon (:) is not used.
• Generally, function declaration is done under main ( ) and it’s definition is written outside the main ( ).
Syntax & Function Declaration
Function-name (Parameters list)
or
variable-name = Function-name (Parameters list);
Function Definition :
Function-name (Parameters list)
Parameter declaration;
{
Local variable declaration;
Statement 1;
Statement 2;
return (expression);
}
Function Prototype
In ‘C’ language every function written by the user under main ( ), then written its prototype is also important. Every
variable is define before using them in the program. Function prototype is written before main ( ) and it look same as
header function.
Syntax :
<type> <function-name> (parameters list);
For example :
intsum-num (int a, int b);
int add (int a, int b); etc.
Example of Function Definition
• Write a program, in which user in input temperature in Celsius and out of that will be in Fahrenheit.
Void-facts ( )
{
float cel, fah;
printf ("Enter the temperature in Celsius");
82
1. Formal Parameter : Formal Parameter are those parameter which are written in Header of the function.
2. Actual Parameter : In the statement of the function, parameters written in the braces ahead of the function
name are called Actual Parameter.
For example :
#include <stdio.h>
int average (int a, int b);
void main ( )
{
int x, y, z;
printf ("Enter any two numbers");
scanf ("%d %d", &x, &y);
z = average (x, y);
printf ("Average of two no. is = %d", z);
}
int average (int a, int b)
{
int c;
c = (a + b)/2;
return (c);
}
Output :
Enter any two numbers
26
30
Average of any two no is 28
Note : In above program, x and y are Actual parameters and a and b are formal parameter.
qqq
83
Solved Paper-1
Computer Science (Class-10)
Time : 3 hrs. 15 min. M.M. : 70
Instructions :
(i) First 15 minutes are allotted for reading the question paper.
(ii) All questions are compulsory.
(iii) Please clear your answer with labelled diagram if required.
(iv) The fixed marks of all questions are mentioned in front of them.
A
Ans. Y
B(suppose)
Y = (A ¢)B + A ¢B ¢ = AB + AB = A B
(b) Write short notes on the followings : (i) LAN (ii) WAN
Ans. (i) LAN (Local Area Network) : It is a network which is designed to operate over a small physical area
such as an office, factory or a group of buildings. LANs are very widely used in a variety of applications.
84
(ii) WAN (Wide Area Network) : Wide area networks are basically packet switching networks. A WAN
provides long distance transmission of data, voice image and video information over larger geographical
area.
(c) Write the commands to see directory, to make directory, to destory directory and to copy directory in linux
operating system.
Ans. To see directory— 1s
To make directory— mkdir
To destory directory—rmdir
To copy directory— cp
(d) Which function is used to find the length of a string?
Ans. strlen( ) function.
(e) What is www? Explain.
Ans. www is an internet server which supports hypertext and multimedia to access several internet protocol on a
single interface. It's full form is World Wide Web.
3. Answer the following questions : 5×2=10
(a) Draw a block diagram of a computer and write the names of each block.
M.U.
Memory Unit
A.L.U.
Arithmetic
Input unit Output unit
Logic Unit
C.U.
Control Unit
Modem
85
It changes the digital data from your computer into analog data, a format that can be carried by telephone
lines. In a similar manner, the computer receiving the data converts analog data to digital data through a
modem. The process of converting digital signals to analog is called modulation and analog to digital signal
is called demodulation.
(c) Explain the e-mail?
Ans. Electronic mail or e-mail is information stored on a computer that is exchanged between two users over
telecommunications. More plainly, e-mail is a message that may contain text, files, images or other
attachments sent through a network to a specified individual or group of individuals. The first e-mail was
sent by Ray Tomlinson in year 1971. By the year 1996, more e-mail was being sent in comparison to
postal mail.
(d) What is file? Explain functions fscanf ( ) and fgetc ( ) in ‘C’ language.
Ans. A file is such a place on a disc, where a group of related data is stored. This data storage is unstable.
fscanf ( ) function : It is used for handling files. This function is used to read any type of data.
syntax : fscanf (FILE *filepointer, constant char *format_string);
fgetc ( ) function : It is used to read a character from the file.
syntax : int fgetc (FILE *filepointer);
(e) Write the different types of Linux.
Ans. (i) Cent OS (ii) Red Hat (iii) Fedora (iv) Ubuntu (v) open SUSE (vi) Debian
(vii) Linux Mint (viii) Arch Linux (ix) Slackware (x) Puppy Linux
4. Answer all parts : 5×2=10
(a) Explain the fundamental components of BCD code.
Ans. BCD Code: The Binary Coded Decimal (BCD) code is one of the early computer codes. It is based on the
idea converting each digit of a decimal number into its binary equivalent, rather than converting the entire
decimal value into a pure binary form and store in the memory. Thus, a code, for that particular character, is
stored in memory.
(b) Define one-dimensional and two-dimensional array with example.
Ans. One-dimensional array: One-dimensional or single dimensional have only one subscript. Subscript is
written between the [ ] which is after the array name. Element of an array is like a variable or we can say that
which can only represented by an unique subscript.
For example: int arr [5];
Two-dimensional array: In it, data is stored in the form of table.
For example: int arr [4] [5];
float arr 1 [5] [5];
(c) Explain about library function. Give two examples.
Ans. These are such functions, participate mainly in ‘C’ language. These functions are recognised by their names
and used. Necessary informations in the form of parameters are provided with these functions. These
functions are called library functions or built-in-functions.
Examples: (i) scanf() and (ii) printf()
(d) Explain concatenation of two strings with example.
Ans. Two strings cannot be added as mathematical addition, e.g., String 3 = String 1 + String 2 (incorrect)
To add two strings, first of all we have to define two strings separately and then copy in Third string, for this
the size of third string should be enough that both string may copy in it.
Two strings are added with function strcat( ).
Syntax : strcat (string1, string2);
86
Example : #include<stdio.h>
#include<string.h>
void main( )
{
char a[100], b[100];
printf("Enter the first string");
gets(a);
printf("Enter the second string");
gets(b);
strcat(a, b);
printf("String obtained on concatenation is %s", a);
}
Output : Enter the first string Programming
Enter the second string Language
String obtained on concatenation is Programming Language.
(e) Explain data communication.
Ans. Communication means the electronic transmission of any type of electronic information encompasses
telephone communication, the transmission of television signals, data communication of all forms,
electronic mail, etc.
Data communication is the movement of encoded information from one point to another by means of
electrical or optical transmission system, such types systems generally called data communication networks.
The speed of transfer of data is measured in bit per second (BPS).
5. Answer all the parts : 3×4=12
(a) What are the types of communication ? Also write the applications of communication.
Ans. Communication basically are of two types :
(i) Oral communication
(ii) Written communication
(i) Oral Communication : In this type of communication, data or information is send in the oral form
or we can say that audio is use as message (data) to be transmitted over the channel. In oral
communication we use various method for transmission of data. Conversation between two person are
the best of oral communication.
Following are different form of oral communication are :
Telephone, Intercom, Mobile phone, Voice talk by computer, mail/chatting, etc.
(ii) Written communication : In this type of communication, data is send from one place to another in
written form which means if information in written form is send from one place to another then this
type of communication is called written communication.
Written communication is more important as well as efficient because there is always record of written
communication which send or receiver can use when ever they needed. This also act as important in
computer depended communication.
Following are the different form of written communication :
Fax, E-mail, SMS, Pager, etc.
Applications of communication :
(a) Electronic Banking Service
87
(b) E-shopping
(c) Video Conferencing
(d) Air/Railway Reservation
(e) E-correspondance
(f) E-education
(b) Prove that AB + AC + BC = AB + AC
Ans. AB + AC + BC = AC + AB + AC + BC × 1
= AC + AB + BC(A + A) (From complement law)
= AC + AB + ABC + ABC (From distributive law)
= AC + ABC + AB + ABC (From commutative law)
= AC(1 + B) + AB(1 + C) (From distributive law)
= AC × 1 + AB × 1 (From the property of 1)
= AC + AB Proved.
(c) Explain High Level Language (HLL).
Ans. HLL languages are not based on internal working procedure of computer. Some selected words of English
and signs used in elementary mathematics are used in these language. To find the error and to remove those
are very easy in it, but it is necessary to translate or compile the programs written in these languages.
Generally, computer programes are written in HLL.
6. Answer all parts : 3×4=12
(a) Prove in Boolean algebra AB + A + AB = 0
Ans. AB + A + AB = 0
= (AB) × A × AB (From Demorgan law)
= AB × A × AB (From envulation law)
= AB × AB × A (From commutative law)
=0×A (From complement law)
= 0 Proved.
(b) What is string? Explain its types.
Ans. String : Refer to Q.2 (VSA type questions) in Chap 7.
Types of string :
(i) Strcat( ) Function : With the help of the function two different string can be connected with each
other which mean this function take first string and connect (join) second string at the end of the first
string. Process of connecting two string is called concatenation.
(ii) Strcpy( ) Function : With the help of this function we can copy on string into the another string or we
can say that this can copy first string in place of second string.
(iii) Strcmp( ) Function : With the help of this string function we can compare two string. If both string is
same than it provide ‘O’ else if both are different then both string are compared not on the bases of
length but on the bases of element stored.
(iv) Strlen( ) Function : With the help of this function we determine the length of strings or number of
element present in the string.
(v) Strcat( ) : This function appends or concatenates copy of source string to the end of target string.
For example : if source string is ‘‘Bhardwaj’’ and target string is ‘‘Neeraj’’ then strcat will return
‘‘Neeraj Bhardwaj’’.
88
(vi) Strrev( ) : This function is used to reverse all the characters of string. It means the position of the
characters will be reversed by using this function.
(vii) Strlwr( ) : This function is used to convert string of upper case to lower case.
(viii) Strupr( ) : This function is opposit of strlwr function as it is used to convert lower case (a to z) to upper
case (A to Z).
(c) Describe recursion with example.
Ans. When a function calls itself in its definition, then such situation is known as recursion and function is called
recursive function.
Example : Write a program to find factorial of a given number.
#include <stdio.h>
main ( )
{
int n;
printf ("Enter any number");
scanf ("%d, =%d", n, fact (n));
}
int fact (int x)
{
if (x = =0)
return (1);
else
return (x *fact (x-1));
}
Result : Enter any number = 5
5! = 120
7. Write a program in ‘C’ language which reads the data of a file whose name is ‘‘Student.txt’’ and write in the next
file whose name is ‘‘Record.txt’’ and print on the screen also. 8
Ans. #include<stdio. h>
#include<conio. h>
#include<stdlib. h>
void main ()
{
File *fptr1, *fptr2;
char ch;
clrscr ();
printf (''Open the file for reading");
fptr1 = fopen ("Student. txt", "r");
if (fptr1 == NULL)
{
printf (" Cannot open the file");
exit (0);
}
89
(b) fclose ( ) command : It is used to close an opened file. By using this command a user can close more than
one files simultaneously.
syntax : fclose (FILE * filepointer);
(c) getc ( ) command : It is used to read a character from a file.
syntax : getc (FILE * filepointer);
(d) putc ( ) command : It is used to write a character in a file.
syntax : putc (character, FILE * filepointer);
(e) fgetc ( ) command : It is used to read a character from the file.
syntax : int fgetc (FILE * filepointer);
(f) fprintf ( ) command : It is used to write the value of data in a file.
syntax : fprintf (FILE * filepointer, constant char *format_string);
(g) fscanf ( ) command : It is used to read data value in a file.
syntax : fscanf (FILE * filepointer, constant char *format_string);
(h) getw ( ) and putw ( ) command : Refer to Q. 2 (Short Answer Type questions) in Chap 9.
(i) feof ( ) command : It is used to examine that file pointer reached at the end of the file or not.
syntax : int feof (FILE * filepointer);
(j) fflush ( ) command : Refer to Q. 5 (Short Answer Type questions) in Chap 9.
(k) fseek ( ) command : Refer to Q. 5 (Short Answer Type questions) in Chap 9.
(l) ftell ( ) command : It is used to know the number of bytes used from starting to end of a file.
syntax : long ftell (FILE * file pointer);
(m) rewind ( ) command : It is used to set the file pointer in the starting of the file. Its advantage is that we
can read or write a file again and again without open or close it.
syntax : void rewind (FILE * filepointer).
(b) Explain searching, sorting and merging and give example of each. 4
Ans. Searching : Searching means find or select. To find some text or written information or group of data according
to the need of the user in programming language is called searching.
Example: The given program searches the number chose by sequential search out of a positive whole number test
list.
Program: This can be explained by following example :
#include <stdio.h>
main ( )
{
int num [50], n, i;
int temp, flag = 0;
printf ("Enter the size of the list :\n");
scanf ("%d", &n);
printf ("Enter the integer number :\n");
for (i = 0; i< n; i++)
{
scanf("%d", & num [i]);
printf ("Enter the number search for :")
scanf ("%d", temp)
91
8. Write a program in ‘C’ language, which write the names of 20 students of a class and in front of each name write
the average marks of four subjects also. 8
Ans. #include<stdio. h>
#include<conio. h>
void main ()
{
int i, j, marks, sum = 0;
float avg;
char name [30];
clrscr ();
for (i=1 ; i<20; i++)
{
printf (" Enter the student name\t");
scanf ("%s", name);
sum = 0 ;
printf ("\n Enter subject marks of %s", name);
for (j=1, j<=4, j++)
{
scanf ("%d", &marks);
sum = sum+marks;
avg = sum/4;
}
printf ("Average marks = % f\n", avg);
}
getch ();
}
Or
What is array? What are its types? Write a programe in C language by using array which calculates average value
of 50 whole numbers placed in array. 8
Ans. A single array is the group of same type of data, which could be represented by same name-important thing in this
is that data stored in array are of same type as well as same size. In the array, every element is stored in it with the
help of subscript which written in [ ] after name of Array. This is also called index variable or we can say each
element stored in array is self contained.
Array are of two types : (a) One-dimensional Array (b) Two-dimensional Array
(a) One-dimensional Array : One-dimensional or single dimensional have only one subscript. Subscript is
written between the [ ] which is after the array name. Element of an array is like a variable or we can say that
which can only represented by an unique subscript.
Let us understand this with the help of a example, how it is declared and it’s syntax.
Syntax : < Type of an Array > < Name of an Array > [Element/size];
For example :
int arr [5];
char name [10];
means
94
arr =
[0] [1] [2] [3] [4]
name =
[0] [1] [2] [3] [4] [5] [6] [7] [8] [9]
Here arr[5] means 1-dimensional array of int type, which will store integer value or we can say every element of
array such as arr [0], arr [1], arr [2], etc. will only be represent by one subscript such as 0, 1, 2, etc. In this way
arr[ ] is a 1-dimensional type of array.
Char name [10] means name is char type of 1-dimensional array which is the group of 10 characters or 10
characters are stored.
Means char name [10] = “ALLAHABAD”
A L L A H A B A D ‘\0’
[0] [1] [2] [3] [4] [5] [6] [7] [8] [9]
As we known, one int variable take 2 Byte space. So array of 5 element need 10 byte (2 × 5 = 10) space. In the
same way, 1 char variable take 1 byte space which means Array of 8 element need 8 byte space.
(b) Two-dimensional Array: Like one-dimensional array which has only one subscript,in the same way,
two-dimensional Array have two subscript.This also called as Matrix. As in a matrix, every element is pointed by
it’s row as well as column, in the same way, for pointing the element two subscript are used in which first subscript
is called row while second subscript is called column.
For example :
First column Second Third column
column
[0] [1] [2]
First row [0] [0] [0] [0] [1] [0] [2]
Second row [1] [1] [0] [1] [1] [1] [2]
Third row [2] [2] [0] [2] [1] [2] [2]
Initialization of Two-dimensional Array : Initial value can be given to the two-dimensional array only at
the time of declaration. Initial value to this array can be given as follows :
Syntax :
<Type of Array> <Name of Array> [No. of row] [No. of column] = [Value 1, Value 2...]
OR <Type of Array> <Name of Array> [No. of row] [No. of column]
= {{Value of first row} {Value of second row}};
For example :
int num [2] [2] = {6, 18, 23, 30};
OR int num [2] [2] = {{6, 18}, {23, 30}};
In the above example, int num [2] [2] = {6, 18, 23, 30}; first value written between { }, i.e., (6) will be the first
element or it will stored at num [0] [0]. And in the same way 18, 23 and 30 are stored in continuous order(way).
If the address of num [0] [0] is 1048 in memory then,
num[0][0] num[0][1] num[1][0] num[1][1]
6 18 23 30 ¬¾ Value
1048 1050 1052 1054 ¬¾ Address
Programe in C language which calculates average value of 50 whole numbers placed in an array.
#include<stdio.h>
#include<conio.h>
void main ( )
{
int n = 50, i, a [50], sum = 0, avg;
clrscr ( );
printf (“Enter the 50 whole numbers”);
for (i = 0; i<n; i++)
{
scanf (“%d”, &a[i]);
}
for (i = 0; i<n; i++)
{
sum = sum + a [i];
}
avg = sum/n;
printf (“%d”, avg);
getch ( );
}
96
Unsolved Paper-1
Computer Science (Class-10)
Time : 3 hrs. 15 min. M.M. : 70
Instructions :
(i) First 15 minutes are allotted for reading the question paper.
(ii) All questions are compulsory.
(iii) Please clear your answer with labelled diagram if required.
(iv) The fixed marks of all questions are mentioned in front of them.
Unsolved Paper-2
Computer Science (Class-10)
Time : 3 hrs. 15 min. M.M. : 70
Instructions :
(i) First 15 minutes are allotted for reading the question paper.
(ii) All questions are compulsory.
(iii) Please clear your answer with labelled diagram if required.
(iv) The fixed marks of all questions are mentioned in front of them.
Unsolved Paper-3
Computer Science (Class-10)
Time : 3 hrs. 15 min. M.M. : 70
Instructions :
(i) First 15 minutes are allotted for reading the question paper.
(ii) All questions are compulsory.
(iii) Please clear your answer with labelled diagram if required.
(iv) The fixed marks of all questions are mentioned in front of them.
(c) Give names of main methods of sorting and explain any one method with example.
6. Answer all parts : 3×4=12
(a) Give names of various desktops available in Linux and describe any one of them.
(b) Define 1’s complement and 2’s complement and describe their applications.
(c) Why are the Library functions ? Describe in details any two types of them.
7. Write a program in C language which tests the imputed number and checks whether the number is even or odd. 8
Or
(a) Explain with examples the basic structure of C program. 4
(b) Describe the main features of printf and getchar functions. 4
8. What do you understand by Array ? What are its different types ? Describe each of them. 8
Or
Write a program in C language which to reuse the list of given numbers. 8
Unsolved Paper-4
Computer Science (Class-10)
Time : 3 hrs. 15 min. M.M. : 70
Instructions :
(i) First 15 minutes are allotted for reading the question paper.
(ii) All questions are compulsory.
(iii) Please clear your answer with labelled diagram if required.
(iv) The fixed marks of all questions are mentioned in front of them.
Unsolved Paper-5
Computer Science (Class-10)
Time : 3 hrs. 15 min. M.M. : 70
Instructions :
(i) First 15 minutes are allotted for reading the question paper.
(ii) All questions are compulsory.
(iii) Please clear your answer with labelled diagram if required.
(iv) The fixed marks of all questions are mentioned in front of them.
(c) What is command line interface in Linux operating system? Write its applications.
(d) Give examples of one-dimensional and two-dimensional arrays.
(e) Write the names of elements of computer network.
5. Answer all the parts : 3×4=12
(a) Draw the logic diagram of the given logic equation and write the truth table.
Y = ( A + B)( B + C )( A + C )
(b) What is editor in Linux? Explain VI-editor and write their modes.
(c) Describe safety system, their features and their advantages in Linux.
6. Answer all parts : 3×4=12
(a) Explain searching, sorting and merging and give example of each.
(b) Discuss the necessity of user defined function with examples of its uses.
(c) Prove by Boolean laws : ( A + B)( A + C )( B + C ) = ( A + B)( A + C )
7. Write a program in ‘C’ language which reads the data of a file whose name is “Student.txt” and write in the next
file whose name is “Record.txt” and print on the screen also. 8
Or
(a) Explain file in ‘C’ language and write its types. Discuss main ‘C’ functions for reading data from a file. 4
(b) Explain the following file functions : 4
(i) fseek () (ii) rewind () (iii) feof() (iv) feof(ft)
8. Write a program in ‘C’ language, which write the names of 20 students of a class and in front of each name write
the average marks of four subjects also. 8
Or
What is “Array” ? What are its different types ? Write a program in ‘C-language’ using array which calculates
average value of 50 whole numbers placed in an array. 8