0% found this document useful (0 votes)
108 views34 pages

Syed Ammal Engineering College: Department of Computer Science and Engineering

The document contains a question bank for the Computer Programming course at Syed Ammal Engineering College. It includes 27 questions about computer fundamentals covering topics such as the definition of computers, characteristics, components, generations, applications, and the differences between hardware and software.

Uploaded by

Guru Balan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
108 views34 pages

Syed Ammal Engineering College: Department of Computer Science and Engineering

The document contains a question bank for the Computer Programming course at Syed Ammal Engineering College. It includes 27 questions about computer fundamentals covering topics such as the definition of computers, characteristics, components, generations, applications, and the differences between hardware and software.

Uploaded by

Guru Balan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 34

SYED AMMAL ENGINEERING COLLEGE

(An ISO 9001: 2008 certified Institution)


Dr. E.M.AbdullahCampus,Ramanathapuram – 623 502.
Department of Computer Science and Engineering

GE6151 – COMPUTER PROGRAMMING


QUESTION BANK

UNIT – I
1. Define computers?
A computer is a programmable machine or device that performs pre-defined or programmed
computations or controls operations that are expressible in numerical or logical terms at high
speed and with great accuracy.
(Or)
Computer is a fast operating electronic device, which automatically accepts and store input data,
processes them and produces results under the direction of step by step program.

2. Why computer is know n as data processing system? (MAY 2009)


Any process that uses a computer program will enter data and summarize, analyze or otherwise
convert data into usable information. The process may be automated and run on a computer. It
involves recording, analyzing, sorting, summarizing, calculating, disseminating and storing data.
Thus Computer is known as data processing system.

3. What is Data and Information?


Data - Data is the fact or raw material for the information processing.
Information – The processed data is called information.

4. What are the basic operations of Computer?


1) It accepts data or instructions by way of input.
2) It stores data.
3) It can process data as required by the user.
4) It gives results in the form of output.
5) It controls all operations inside a computer.

5. Give the applications computer?


· Word Processing
· Internet
· Desktop publishing
· Digital video or audio composition
· Mathematical Calculations
· Robotics
· Weather analysis

6. What are the characteristics of computers? (JAN 2009)


· Speed
· Endurance.
· Versatility.
· Storage.
· Cost Reduction.

7. How will you classify computer systems? (JAN2009)


SYED AMMAL ENGINEERING COLLEGE
(An ISO 9001: 2008 certified Institution)
Dr. E.M.AbdullahCampus,Ramanathapuram – 623 502.
Department of Computer Science and Engineering
Based on physical size, performance and application areas, we can generally divide computers
into four major categories:
1. Micro computer
2. Mini Computer
3. Mainframe computer and
4. Super Computer

8. Specify the Electronic components used for different computer generations.


Generations Electronic Components
I Generation Vacuum tubes
II Generation Transistors
III Generation Integrated Circuits
IV Generation Microprocessors
V Generation Artificial Intelligence

9. Compare Computer with calculator

SNO Characteristic Calculator Computer


1 Speed Fast Much Fast
2 Performance Simple Calculation Complex problem and
Numeric processing Non-numeric processing a
3 Memory Less internal memory Large internal memory
No Permanent storage Large permanent storage,
Temporary permanent storage
4 Machine Electronic Device Electronic Device
5 Operation Arithmetic. Arithmetic and logical.

10. What are the languages used in computer generations.


Generations Languages used
I Generation Machine Language.
II Generation Assemble Language, Mnemonics
III Generation High Level Language, BASIC, PASCAL, COBOL,
FORTRON.
IV Generation 4GL
V Generation Artificial Intelligence.

11. Expand ENIVAC, ABC, EDVAC, EDSAC and UNIVAC. (JAN2010)


ENIAC – Electronic Numerical Integrator and Calculator.
ABC – Atanas off and Berry Computer.
EDVAC – Electronic Discrete Variable Automatic Calculator.
EDSAC – Electronic Delay Storage Automatic Calculator.
UNIVAC – UNIversal Automatic Computer.

12. Who is the father of computer? Why?


Charles Babbage is the father of computer, because the parts and working principle of the
Analytical Engine, which is invented by Charles Babbage is similar to today‘s computer.

13. Expand COBOL, BASIC, FORTRON and IBM.


SYED AMMAL ENGINEERING COLLEGE
(An ISO 9001: 2008 certified Institution)
Dr. E.M.AbdullahCampus,Ramanathapuram – 623 502.
Department of Computer Science and Engineering
COBOL – Common Business Oriented Language.
BASIC - Beginner‘s All Purpose Symbolic Instruction Code.
FORTRON – FORmula TRANslation.
IBM – International Business Machine.

14. Expand IC, SSI, MSI, LSI, and VLSI.


IC – Integrated Circuit.
SSI -Small Scale Integration.
MSI - Medium Scale Integration.
LSI - Large Scale Integration.
VLSI - Very Large Scale Integration.

15. What are the components of the computer systems?


Basic components of the computer system are Input Unit, Central Processing Unit, Secondary
Storage Unit and Output Unit.

16. What are the functions in the input unit?


An input device is a device that is used to input data or information into a computer. Some
examples of input devices include: Keyboards. Computer mice, Light Pen, Digitizer, Touchpad,
Trackball, Image scanner, Webcam, Video capture / tuner cards, Microphones, MIDI
instruments.
·
17. What are the functions in the output unit?
In computers, a unit which delivers information from the computer to an external device or from
internal storage to external storage. Speakers, Printer, Headphone, Monitor (or) Visual Display
Unit (VDU), Plotter.

18. What is an ALU?


Arithmetic logic unit, the part of a computer that performs all arithmetic computations, such as
addition and multiplication, and all logical operations such s comparison operations. The ALU is
one component of the CPU (central processing unit).

19. Define Clients and Servers.


A client is generally a single-user PC or workstation that provides a highly user-friendly
interface to the end user. It runs client processes, which send service requests to the server.
A server is generally a relatively large computer that manages a shared resource and provides a
set of shared user services to the clients. It runs the server process, which services client requests
for use of the resource managed by the server. The network may be single LAN or WAN or an
internet of networks.

20. What is a CPU?


The CPU (central processing unit) is the part of a computer controls the interpretation and
execution of instructions. Generally, the CPU is a single microchip.
(Or)
The computing part of the computer. Also called the "processor," it is made up of the control unit
and ALU. Today, the CPUs of almost all computers are contained on a single chip. The CPU,
clock and main memory make up a computer. A complete computer system requires the addition
of control units, input, output and storage devices and an operating system.
SYED AMMAL ENGINEERING COLLEGE
(An ISO 9001: 2008 certified Institution)
Dr. E.M.AbdullahCampus,Ramanathapuram – 623 502.
Department of Computer Science and Engineering

21. What is meant by generation in computer terminology?


Generation is the period of years in which the computers are enhanced as previous.

22. Define personal computers?


A small, relatively inexpensive computer designed for an individual user. In price, personal
computers range anywhere from a few hundred dollars to thousands of dollars. All are based on
the microprocessor technology that enables manufacturers to put an entire CPU on one chip.
Example:
· Businesses use personal computers for word processing, accounting, desktop publishing, and
for running spreadsheet and database management applications.
· At home, the most popular use for personal computers is for playing games.

23. Define Mainframe computer?


Mainframes are computers used mainly by large organizations for critical applications, typically
bulk data processing such as census, industry and consumer statistics, enterprise resource
planning, and financial processing. The term probably had originated from the early mainframes,
as they were housed in enormous, room-sized metal boxes or frames.

24. Define Mini computers?


A mini computer is a multi-user or time -sharing system. It is used for medium scale data
processing such as Bank account processing, Payroll processing etc., Mini computer process
greater storage capacity and larger memories as compared to micro computer.

25. Define super computer?


The fastest type of computer. Supercomputers are very expensive and are employed for
specialized applications that require immense amounts of mathematical calculations. For
example, weather forecasting requires a supercomputer. Other uses of supercomputers include
animated graphics, fluid dynamic calculations, nuclear energy research, and petroleum
exploration.

26. Define Software?


Computer instructions or data, anything that can be stored electronically is software.
(Or)
Computer software or just software is a general term used to describe the role that computer
programs, procedures and documentation in a computer system.

27. Define Hardware?


Computer hardware - (computer science) the mechanical, magnetic, electronic, and electrical
components making up a computer system hardware. Hardware includes not only the computer
proper but also the cables, connectors, power supply units, and peripheral devices such as the
keyboard, mouse, audio speakers, and printers.

28. What is an instruction?


SYED AMMAL ENGINEERING COLLEGE
(An ISO 9001: 2008 certified Institution)
Dr. E.M.AbdullahCampus,Ramanathapuram – 623 502.
Department of Computer Science and Engineering
An instruction is a basic command. The term instruction is often used to describe the most
rudimentary programming commands. For example, a computer's instruction set is the list of all
the basic commands in the computer's machine language.

29. Define memory?


Computer memory refers to devices that are used to store data or programs (sequences of
instructions) on a temporary or permanent basis for use in an electronic digital computer.

30. What is a volatile and non-volatile memory?


Volatile memory: also known as volatile storage is computer memory that requires power to
maintain the stored information, unlike non-volatile memory which does not require a
maintained power supply. It has been less popularly known as temporary memory.
Non-volatile memory: nonvolatile memory, NVM or non-volatile storage, is computer memory
that can retain the stored information even when not powered. Examples of non-volatile
memory
· read-only memory
· flash memory
· most types of magnetic computer storage devices (e.g.hard / floppy disks & magnetic tape)
· optical discs

31. What is a primary memory?


The primary memory or the main me mory is part of the main computer system. The processor or
the CPU directly stores and retrieves information from it. This memory is accessed by CPU, in
random fashion. That means any location of this memory can be accessed by the CPU to either
read information from it, or to store information in it.
Types of Primary Memory:
· RAM is RWM (Read Write Memory), the CPU can write and read information from any
primary memory location implemented using RAM.
· ROM stands for Read Only Memory.

32. What is a secondary memory?


The secondary memory is much slower and also less costly. It stores the data permanently unless
it is erased.
Examples:
Floppy disk storage media
Hard disk
CD / DVD
Pen drive
Memory chips etc.,

33. What is a microprocessor?


A microprocessor incorporates most or all of the functions of a central processing unit (CPU) on
a single integrated circuit (IC). The first microprocessors emerged in the early 1970s and were
used for electronic calculators, using binary-coded decimal (BCD) arithmetic on 4-bit words.

34. What is transistor?


SYED AMMAL ENGINEERING COLLEGE
(An ISO 9001: 2008 certified Institution)
Dr. E.M.AbdullahCampus,Ramanathapuram – 623 502.
Department of Computer Science and Engineering
A device composed of semiconductor material that amplifies a signal or opens or closes a circuit.
Invented in 1947 at Bell Labs, transistors have become the key ingredient of all digital circuits,
including computers. Microprocessors contain tens of millions of microscopic transistors.

35. What is an IC? How does it help in re ducing the size of Computers?
IC is an Integrated Circuit; it integrates large number of circuit elements into very small
surface (less than 5mm square) of silicon known as Chip‘s.

36. What are the components of the computer systems?


· Input Unit
· Central Processing Unit.
· Secondary Storage Unit.
· Output Unit.

37. Define number system.


The term computer numbering formats refers to the schemes implemented in digital computer
and calculator hardware and software to represent numbers. For example, if one multiplies: one
might perhaps expect to get a result of exactly 1, which is the correct answer when applying an
exact rational number or algebraic model. In practice, however, the result on a digital computer
or calculator ma y prove to be something such as precisely 0.9999999999999999 (as one might
find when doing the calculation on paper) or, in certain cases, perhaps 0.99999999923475.

38. What are the types of Number System?


· Positional Number System.
· Non-Positional Number System.

39. What are the positional number systems and what is their base?
Number System Base
Decimal Number System 10
Binary Number System 2
Octal Number System 8
Hexa Decimal Number System 16

40. Define (1) Nibble (2) Bit (3) Byte?


(1) In computers and digital technology, a nibble is four binary digits or half of an eight-bit byte.
A nibble can be conveniently represented by one hexadecimal digit.
(2) A bit (short for binary digit) is the smallest unit of data in a computer. A bit has a single
binary value, either 0 or 1. Although computers usually provide instructions that can test and
manipulate bits, they generally are designed to store data and execute instructions in bit multiples
called bytes.
(3) In most computer systems, a byte is a unit of data that is eight binary digits long. A byte is
the unit most computers use to represent a character such as a letter, number, or typographic
symbol (for example, "g", "5", or "?"). A byte can also hold a string of bits that need to be used
in some larger unit for application purposes.

41. What is a Base?


A base is the total number of bits in the number system.
SYED AMMAL ENGINEERING COLLEGE
(An ISO 9001: 2008 certified Institution)
Dr. E.M.AbdullahCampus,Ramanathapuram – 623 502.
Department of Computer Science and Engineering
42. What is meant by conversion in number system?
Conversion is the process of converting from one number system to another number system.
Example:
· Decimal to Octal.
· Hexadecimal to Decimal

43. Define (1) MSB (2) LSB?


(1) In computing, the most significant bit (MSB) is the bit position in a binary number having the
greatest value. The MSB is sometimes referred to as the left-most bit on big-endian architectures,
due to the convention in positional notation of writing more significant digits further to the left.
The MSB can also correspond to the sign of a signed binary number in one or two's complement
notation. "1" meaning negative and "0" meaning positive.
(2) In computing, the least significant bit (LSB) is the bit position in a binary integer giving the
units value, that is, determining whether the number is even or odd. The LSB is sometimes
referred to as the right-most bit, due to the convention in positional notation of writing less
significant digit further to the right.

44. Specify the method to convert decimal number system.


1. Remainder method.
2. Power method.

45. What is a binary number system?


The binary numeral system or base-2 number system represents numeric values using two
symbols, 0 and 1. More specifically, the usual base-2 system is a positional notation with a radix
of 2.

46. What is a decimal number system?


The decimal numeral system (also called base ten or occasionally denary) has ten as its base. It is
the most widely used numeral base.
Examples are
· Roman numerals.
· Brahmi numerals.
· Chinese numerals.
· Hindu-Arabic numerals.
· Roman numerals have symbols for the decimal powers (1, 10, 100, and 1000).

47. What is an octal number system?


The octal numeral system, or oct for short, is the base-8 number system, and uses the digits 0 to
7. Numerals can be made from binary numerals by grouping consecutive binary digits into
groups of three (starting from the right).
For example:
112 in octal is equal to 64+8+2 = 74 in decimal. Octal is sometimes used in computing instead of
hexadecimal.

48. What is a hexadecimal number system?


In mathematics and computer science, hexadecimal (also base-16, hexa, or hex) is a numeral
system with a radix, or base, of 16. It uses sixteen distinct symbols, most often the symbols 0–9
SYED AMMAL ENGINEERING COLLEGE
(An ISO 9001: 2008 certified Institution)
Dr. E.M.AbdullahCampus,Ramanathapuram – 623 502.
Department of Computer Science and Engineering
to represent values zero to nine, and A, B, C, D, E, F (or a through f) to represent values ten to
fifteen. Its primary use is as a human-friendly representation of binary coded values, so it is often
used in digital electronics and computer engineering. Since each hexadecimal digit represents
four binary digits (bits)—also called a nibble—it is a compact and easily translated shorthand to
express values in base two.

49. Write short notes on primary storage.


Stores and provides very fast. This memory is generally used to hold the program being currently
executed in the computer, the data being received from the input unit, the intermediate and final
results of the program. The primary memory is temporary in nature. The data is lost, when the
computer is switched off. In order to store the data permanently, the data has to be transferred to
the secondary memory.

50. Write short notes on secondary storage.


Secondary storage is used like an archive. It stores several programs, documents, data bases etc.
the programs that we run on the computer are first transferred to the primary memory before it is
actually run. Whenever the results are saved, again they get stored in the secondary memory. The
secondary memory is slower and cheaper than the primary memory. Some of 1 the commonly
used secondary memory devices are Hard disk, CD, etc.,

51. List out the types of computers based on size, memory capacity.
1. Micro computers
2. Mini computers
3. Mainframe computers
4. Super computers

53. What are the major operations of computers?


A computer performs basically 5 major operations or functions irrespective of their size they are
· It accepts data or instructions by way of input.
· It stores data.
· It can process data as required by the user.
· It gives results in the form of output.
· It controls all operations inside a computer.

54. Write short notes on cache memory.


The speed of CPU is extremely high compared to the access time of main memory. Therefore,
the performance of CPU decreases due to the slow speed of main memory. To decrease the
mismatch in operating speed, a small memory chip is attached between CPU and main memory
whose access time is very close to the processing speed of CPU. It is called CACHE me mory.
CACHE memories are accessed much faster than conventional RAM. It is used to store
programs or data currently being executed or temporary data frequently used by the CPU. So
each memory makes main memory to be faster and larger than it really is. It is also very
expensive to have bigger size of cache memory and its size is normally kept small.

55. Write the binary and octal equivalent of hexadecimal number 7BD? (APR2009)
Binary Equivalent of 7BD = (0111 1011 1101)2
Octal Equivalent of 7BD = (011 110 111 101) = (3675)8
SYED AMMAL ENGINEERING COLLEGE
(An ISO 9001: 2008 certified Institution)
Dr. E.M.AbdullahCampus,Ramanathapuram – 623 502.
Department of Computer Science and Engineering

56. Give any tw o tasks, which humans perform better than computers? (JAN2009)
• Humans can communicate better than computers.
• Humans are much reliable than computers.

57. What is the use of computer in medicine and healthcare? (JAN2009)


· Study of biological vision system.
· Medical Imaging.
· Mobile healthcare technology.
· Nano technology.
· Bioinformatics.

58. Convert binary number 100110 into its octal equivalent? (JAN2009)
Octal equivalent of 100110 = (100 110) = (46)8

59. What are registers? (JAN2009)


A special, high-speed storage area within the CPU. All data must be represented in a register
before it can be processed.
For example,
if two numbers are to be multiplied, both numbers must be in registers, and the result is also
placed in a register.

60. Differentiate analog and digital computers? (JAN2010)


S No Analog Computer Digital Computer
1 Process measured data Process discrete data
2 Analog computers are not precise Digital computers are more precise
3 Processing speed is low. Processing speed is high.
4 Less accuracy. More accuracy.

61. Find the decimal equivalent of hexadecimal number 4D.C8 (JAN2010)


4D.C8 = 4 X 161 + 13 X 162 + 12 X 16-1 + 8 X 16-2
= 64 + 13 +0.75 + 0.03125
= (77.78)2

62. Convert hexadecimal number into binary equivalent of EBC (JAN2010)


Binary equivalent of EBC = (1110 1011 1100)2

UNIT II

1. Define Computer Software?


Software is a set of programs or collection of programs that is executed by the Computer‟s CPU
to function it in a desired way.

2. What is meant by Installation and Assembling?


Installation – It is the process of loading the software package into the computer.
SYED AMMAL ENGINEERING COLLEGE
(An ISO 9001: 2008 certified Institution)
Dr. E.M.AbdullahCampus,Ramanathapuram – 623 502.
Department of Computer Science and Engineering
Assembling – It is the process of mounting different computer peripherals into one, to make the
computer to function properly.

3. Define Hardware.
Hardware is the physical components of the computer.

4. What are the types of Software?


1. Application software.
2. System software.

5. Define OS.
An operating system is a set of programs, which are used to control and co-ordinate the computer
system.

6. What are the basic functions of an OS?


• Process Management.
• Memory Management.
• File Management.
• Device Management.
• Security Management.
• User Interface.

7. What are the types of Operating System?


• Single user operating system.
• Multi-user operating system.
• Time sharing operating system.
• Virtual storage operating system.
• Real time operating system.
• Multiprocessing operating system.
• Virtual machine operating system.

8. Define Multiprocessing?
Multiprocessing is the process of executing a single job by using multiple CPU‟s.

9. What are language translators?


The language translators are the programs which come under system software category. They are
Compilers, Interpreters and Assembler.

10. What are a Compiler, Assembler and Interpreter?


Compiler: It is a program which is used to convert the high level language program into
machine language.
Assembler: It is a program which is used to convert the assembly level language program into
machine language.
Interpreter: It is a program; it takes one statement of a high level language program, translates
it into machine language instruction and then immediately executes the resulting machine
language instruction.

11. What is Device Driver?


SYED AMMAL ENGINEERING COLLEGE
(An ISO 9001: 2008 certified Institution)
Dr. E.M.AbdullahCampus,Ramanathapuram – 623 502.
Department of Computer Science and Engineering
In computing, a device driver or software driver is a computer program allowing higher- level
computer programs to interact with a hardware device. A driver typically communicates with the
device through the computer bus communications subsystem to which the hardware connects.

12. What is the purpose of a Device Driver?


A device driver simplifies programming by acting as a translator between a hardware device and
the applications or operating systems that use it. Programmers can write the higher-level
application code independently of whatever specific hardware device it will ultimately control,
because code and device can interface in a standard way, regardless of the software
superstructure or of underlying hardware. Every version of a device, such as a printer, requires
its own hardware-specific specialized commands.

13. What is a linker?


A linker is a program that combines object modules to form an executable program. Many
programming languages allow you to write different pieces of code, called modules, separately.
This simplifies the programming task because you can break a large program into small, more
manageable pieces. Modules has to be put together. This is the job of the linker. In addition to
combining modules, a linker also replaces symbolic addresses with real addresses. Therefore,
you may need to link a program even if it contains only one module.

14. What is a loader?


In computing, a loader is the part of an operating system that is responsible for one of the
essential stages in the process of starting a program, loading programs, that is, starting up
programs by reading the contents of executable files (executables- files containing program text)
into memory, then carrying out other required preparatory tasks, after which the program code is
finally allowed to run and is started when the operating system passes control to the loaded
program code.

15. What is Booting?


In computing, booting (also known as "booting up") is a bootstrapping process that starts
operating systems when the user turns on a computer system. A boot sequence is the initial set of
operations that the computer performs when power is switched on. The boot loader typically
loads the main operating system for the computer.

16. What is application software?


An application software is a set of programs, that allows the computer to perform a specific data
processing for the user.

17. How can you obtain required software?


• Buying Pre-defined software.
• Buying customized software.
• Developing the software.
• Downloading from the Internet.

18. What are the categories of application software?


• Customized Application Software.
• General Application Software.
SYED AMMAL ENGINEERING COLLEGE
(An ISO 9001: 2008 certified Institution)
Dr. E.M.AbdullahCampus,Ramanathapuram – 623 502.
Department of Computer Science and Engineering

19. Define the System.


System is a group of interrelated components working together towards a common goal.

20. Specify the personnel’s, w ho are responsible for system design and implementation.
• System Personnel.
• System Analyst.
• System Designer.
• Programmers.
• Users.

21. What is system development cycle?


System development cycle is the sequence of events considered by the system developers to
build the new system or to replace the old one.

22. What are the phases of Software Development Cycle?


• Requirement Analysis.
• Feasibility study.
• System Analysis and Design.
• Coding / Development.
• Testing.
• Implementation.
• Maintenance.

23. What is Software Requirement Specification (SRS) document?


The Software Required Specification (SRS) Document is produced at the end of Requirement
Analysis stage, which specifies all requirements of the customer.

24. What is meant by Testing?


Testing is the process of executing the proposed software with sample or test data and put into
regular use.

25. How the system can be tested?


• Unit Testing.
• Integration Testing.
• System Testing.
• User Acceptance Test and Installation Testing.
26. What is Design?
The Design is the process of specifying the detailed operation of the system.

27. Classify the Design phase.


• High-Level Design (System Design)
• Low-Level Design (Detailed Design)

28. What is meant by Coding?


Coding is the process of writing program in a programming langua ge.
SYED AMMAL ENGINEERING COLLEGE
(An ISO 9001: 2008 certified Institution)
Dr. E.M.AbdullahCampus,Ramanathapuram – 623 502.
Department of Computer Science and Engineering
29. What is Implementation & Maintenance?
Implementation is the process of putting the system into regular use.
Maintenance is the process of enhancing the system after installation.

30. What is Internet?


Internet is a collection of interconnected computer networks linked by copper wires, fiber optic
cables and wireless connections etc,

31. Define protocol?


Protocol is a set of rules which is used by computers to communicate with each other across a
network. A protocol is a convention or standard that controls or enables the connection,
communication, and data transfer between computing endpoints. In its simplest form, a protocol
can be defined as the rules governing the syntax, semantics, and synchronization of
communication. Protocols may be implemented by hardware, software, or a combination of the
two. At the lowest level, a protocol defines the behavior of a hardware connection.

32. What is Web?


The Web is a collection of interconnected documents and other resources linked by hyperlinks
and URL‟s.

33. What is ARPANET?


It is acrimony for Advanced Research Project Agency NET, created by Department of Defence
(DOD).

34. What is a Web page?


A webpage or web page is a document or resource of information that is suitable for the World
Wide Web and can be accessed through a web browser and displayed on a computer screen. This
information is usually in HTML or XHTML format, and may provide navigation to other web
pages via hypertext links.

35. Define Website?


A website is a collection of WebPages, images, videos or other digital assets that is based on one
or more web servers, usually accessible through the Internet.

36. What is an IP?


IP stands for Internet Protocol, which is the language, that computer used to communicate over
the Internet.

37. Name some of the services of Internet or Internet applications? (JAN2009)


• E-Mail.
• Chat.
• Remote Access.
• File Sharing.
• Voice Telephony.
• File Transfer Protocol.
• Telnet.
• Internet Relay Chat.
• Video Conferencing.
SYED AMMAL ENGINEERING COLLEGE
(An ISO 9001: 2008 certified Institution)
Dr. E.M.AbdullahCampus,Ramanathapuram – 623 502.
Department of Computer Science and Engineering

38. What is HTTP?


Hypertext Transfer Protocol(HTTP) is an application-level protocol for distributed,
collaborative, hypermedia information systems. Its use for retrieving inter-linked resources,
called hypertext documents, led to the establishment of the World Wide Web in 1990. There are
two major versions, HTTP/1.0 that uses a separate connection for every document and HTTP/1.1
that can reuse the same connection to download, for instance, images for the just served page.
Hence HTTP/1.1 may be faster as it takes time to set up the connections.

39. What is TCP/IP?


Transmission Control Protocol/Internet Protocol, the suite of communications protocols used to
connect hosts on the Internet. TCP/IP uses several protocols, the two main ones being TCP and
IP. TCP/IP is built into the UNIX operating system and is used by the Internet, making it the de
facto standard for transmitting data over networks. Even network operating systems that have
their own protocols, such as Netware, also support TCP/IP.

40. Define URL?


A Uniform Resource Locator(URL) is a subset of the Uniform Resource Identifier (URI) that
specifies where an identified resource is available and the mechanism for retrieving it. In popular
usage and in many technical documents and verbal discussions it is often incorrectly used as a
synonym for URI. In popular language, a URI is also referred to as a Web address.

41. Define ISP?


An Internet service provider(ISP), also called Internet access provider , or IAP) is a
company that offers its customer‟s access to the Internet. The ISP connects to its customers
using a data transmission technology appropriate for delivering Internet Protocol datagram‟s,
such as dial-up, DSL, cable modem, wireless or dedicated high-speed interconnects. ISPs may
provide Internet e-mail accounts to users which allow them to communicate with one another by
sending and receiving electronic messages through their ISP's servers. ISPs ma y provide other
services such as remotely storing data files on behalf of their customers, as well as other services
unique to each particular ISP.

42. Define Home page?


The homepage (often written as home page) is the URL or local file that automatically loads
when a web browser starts or when the browser's "home" button is pressed. One can turn this
feature off and on, as well as specify a URL for the page to be loaded. The term is also used to
refer to the front page, web server directory index, or main web page of a website of a group,
company, organization, or individual.

43. Define Web Browser?


A web browser is a software application for retrieving, presenting, and traversing information
resources on the World Wide Web. An information resource is identified by a Uniform Resource
Identifier (URI) and may be a web page, image, video, or other piece of content. Hyperlinks
present in resources enable users to easily navigate their browsers to related resources. The major
web browsers are Windows Internet Explorer, Mozilla Firefox, Apple Safari, Google Chrome,
and Opera.
SYED AMMAL ENGINEERING COLLEGE
(An ISO 9001: 2008 certified Institution)
Dr. E.M.AbdullahCampus,Ramanathapuram – 623 502.
Department of Computer Science and Engineering

44. Differentiate Application and System Software. (JAN / FEB 2009)


S No Application Software System Software
1 Used to perform specific data System software is the code that
processing or computational controls the hardware.
tasks to the user.
2 It runs on top of the OS It forms the foundation and takes
the most basic tasks of the computer care of the computer system.
3 Example: MS-Word Example: Operating System

45. Difference between web page and website. (JAN 2009/JAN 2010)

S No Web page Web site

1 A web page is one screen full A website is a collection of


of information on a particular one or more information (from
subject or site or links to a web site) that may web
external information. pages designed to convey
contain links to other pages in
the web theme to a web user.
2 Every webpage should contain Website will have a domain
a Page Title in the head name. Example: A company
section. A web page may will have a web site providing
contain text, animation or structured information about
graphics elements. the company.
3 Web page is an single entity. Web site can have more than
one web page.

46. Differentiate machine language and high level language. (JAN 2010)

S No Machine language High level Language


1 Represented in numbers. Human readable form.
2 Directly executed by the Central Should be translated into machine
Processing Unit code by compiler / interpreter.
3 Example: Example:
ADD A, B where A and B C, C++
are operands and ADD is an opcode.

47. Difference between Compiler and Interpreter. (JAN 2010)


SYED AMMAL ENGINEERING COLLEGE
(An ISO 9001: 2008 certified Institution)
Dr. E.M.AbdullahCampus,Ramanathapuram – 623 502.
Department of Computer Science and Engineering
S No Compiler Interpreter
1 Executes source code into target or Executes source code
assembly code. directly or to an
intermediate form.
2 Compilers convert once the source Interpreter converts program.
program. program runs.
3 Languages for compiler conversion: Languages for interpreter
C C++. conversion: MATLAB,
Python.

48. What is IP Address?


Internet protocol address is the address of a device attached to an IP network (TCP/IP network).
Every client, server and network device is assigned an IP address, and every IP packet traversing
an IP network contains a source IP address and a destination IP address.

49. Name any four application software packages. (JAN 2009)


Word Processors
Spreadsheets
Data bases
Graphics Presentations
Web browsers

50. What is soft loading? (JAN 2009)


A soft reboot (also known as a warm reboot) is restarting a computer under software control,
without removing power or (directly) triggering a reset line. It usually, though not always, refers
to an orderly shutdown and restarting of the machine. The Control-Alt-Delete key combination is
used to allow the soft rebooting the system.

51. What are the steps involved in booting? (JAN 2009)


First , the Power On Self Tests (POST) is conducted. These tests verify that the system is
operating correctly and will display an error message and/or output a series of beeps known as
beep codes depending on the BIOS manufacturer.
Second, is initialization in which the BIOS look for the video card built in BIOS program and
runs it. The BIOS then looks for other devices' ROMs to see if any of them have BIOS and they
are executed as well.
Third, is to initiate the boot process. The BIOS looks for boot information that is contained in
file called the master boot record (MBR) at the first sector on the disk. If it is searching a floppy
disk, it looks at the same address on the floppy disk for a volume boot sector. Once an acceptable
boot record is found the operating system is loaded which takes over control of the computer.

52. What is the difference between text and graphical browsers? (JAN2010)
S No Text browser Graphical browser
1 No GUI. Based on GUI.
2 Links are based on text entry. Links are present as icons or images.
3 Allow users to display and interact Allow users to display and interact with
only with text on the web pages. various images, present on the web pages.
4 Example: Lynx web browser Example: Internet Explorer, Netscape
Navigator.
SYED AMMAL ENGINEERING COLLEGE
(An ISO 9001: 2008 certified Institution)
Dr. E.M.AbdullahCampus,Ramanathapuram – 623 502.
Department of Computer Science and Engineering

UNIT III
PROBLEM SOLVING AND OFFICE AUTOMATION

1. What is a program?
A program is a set instruction written to carryout a particular task, so that computer can
perform some specified task.

2. What is algorithm? (JAN2009)


Algorithm means the logic of a program. It is a step-by-step description of how to arrive at a
solution of a given problem.

3. What are the steps to solve the problem in a computer system?


Problem must be analyzed thoroughly. Solution method is broken down into a sequence of small
tasks. Based on this analysis, an algorithm must be prepared to solve the problem. The algorithm
is expressed in a precise notation. This notation is known as “Computer Program”. The
Computer program is fed to the computer. The instruction in the program executes one after
another and outputs the expected result.

4. How can you measure the quality of algorithm?


The primary factors that are often used to judge the quality of an algorithm are time requirement,
memory requirement, and accuracy of solution.

5. What are the characteristics of an algorithm?


1. In algorithms each and every instruction should be precise.
2. In algorithms each and every instruction should be unambiguous.
3. The instructions in an algorithm should not be repeated infinitely.
4. Ensure that the algorithm will ultimately terminate.
5. The algorithm should be written in sequence.
6. It looks like normal English.
7. The desired result should be obtained only after the algorithm terminates.

6. How many types the Algorithm can be represented?


Normal English
Program
Flowchart
Pseudo code
Decision table

7. What is decision table?


A decision table is a table containing the selection of conditions to be tested and how those
conditions should be nested to arrive at the proper action.

8. What is Flowchart?
A Flowchart is a pictorial representation of an algorithm. It is often used by programmer as a
program planning tool for organizing a sequence of step necessary to solve a problem by a
computer.
SYED AMMAL ENGINEERING COLLEGE
(An ISO 9001: 2008 certified Institution)
Dr. E.M.AbdullahCampus,Ramanathapuram – 623 502.
Department of Computer Science and Engineering
9. What is the need of Flowchart symbols?
Each symbol of different shapes denotes different shapes denote different types of
instructions. The program logic through flowcharts is made easier through the use of

10. What is pseudo code?


“Pseudo” means imitation of false and “code” refers to the instruction written in the
programming language. Pseudo code is programming analysis tool that is used for planning
program logic.

11. What is structured programming?


A structured programming is a more specific approach to solve a programming problem by using
only the three basic logic structures. They are sequence logic, selection logic and Iteration logic.

12.Draw the flowchart to find the maximum among three numbers (JAN2009)

13. What are the rules for draw ing a flow chart?
 The standard symbols should only be used.
 The arrowheads in the flowchart represent the direction of flow of control in the problem.
 The usual direction of the flow of procedure is from top to bottom or left to right.
 The flow lines should not cross each other.
 Be consistent in using names and variables in the flowchart.
 Keep the flowchart as simple as possible.
 Words in the flowchart symbols should be common statements and easy to understand.
 Chart main line of logic, and then incorporate all the details of logic.
 If a new page is needed for flowcharting, then use connectors for better representation.
 Don’t chart every details or the flowchart will only be graphical represented.

14. What is sequence logic?


Sequence logic is used for performing instructions one after another in a sequence.

15. What is selection logic?


Selection logic is used for selecting the process path out of two or more alternative paths in the
program logic. It uses three control structures called if…then, if… then…else and switch…case.

16. What is Iteration logic?


Iteration logic is used for producing loops in program logic when one or more instructions may
be executed several times depending on some condition. It uses two control structures called
do…while, and repeat…until.

17. What are the rules for writing pseudo code? (MAY2010)
 Write on statement per line.
 Capitalize initial keywords.
 Indent to show hierarchy.
 End multi line structure.
 Keep statements language independent.

18. What are the features of word processors?


SYED AMMAL ENGINEERING COLLEGE
(An ISO 9001: 2008 certified Institution)
Dr. E.M.AbdullahCampus,Ramanathapuram – 623 502.
Department of Computer Science and Engineering
 Fast
 Permanent storage
 Formatting
 Editing
 Graphics
 OLE
 Spell Check
 Mail merge

19. How many types a documented can be viewed?


* Normal view
* Online layout
* Outline view
* Page layout view

20. What are the menus available in Ms-Word?


 File
 Edit
 View
 Insert
 Format
 Tools
 Table
 Window
 Help

21. What is meant by Formatting?


Formatting is the process of changing the appearance of the text in the document.

22. Specify any five toolbars available in Ms-Word?


 Standard
 Formatting
 Drawing
 Tables & Boarders
 WordArt etc.,

23. How many Line Spacing options available in Ms-Word?


 Single
 1.5 Lines
 Double
 At least
 Exactly
 Multiple

24. What are the Text cases available in Ms-Word?


 Sentence case
SYED AMMAL ENGINEERING COLLEGE
(An ISO 9001: 2008 certified Institution)
Dr. E.M.AbdullahCampus,Ramanathapuram – 623 502.
Department of Computer Science and Engineering
 lower case
 UPPER CASE
 Title Case
 tOGGLE CASE

25. What is Subscript and Superscript?


The Subscript format places the text slightly below a line of normal printed text.
Eg:-H2O
The Superscript format places the text slightly above a line of normal printed
Eg:-A2 +B2

26. What is Tab and what are the Tab settings available in word?
Tab is used to control the alignment of text with in the document. Word provides seven types of
tabs.
1. Standard (left) tab
2. Center tab
3. Right tab
4. Decimal tab
5. Bar tab
6. First line Indent tab
7. Hanging Indent tab

27. Define Headers and Footers.


Header allows text, page number or section titles to appear on every page of document at the top
position. Footer allows text, page number or section titles to appear on every page of document
at the bottom position.

28. What is a Table?


A Table is grid of rows and columns.

29. What is a Clipart?


Clipart is the attractive pre-defined, pre-colored pictures available in Ms-Word office suite.

30. Define a Template.


Template is a special kind of document that produces basic tools for shaping a final document.

31. Define operator and formula.


Operator:- An operator is a symbol, which can do a particular action on the operands.
Formula:- Is the mathematical expression used to carryout a particular process.

32. What is a function?


A function is a built-in mathematical shortcut used to perform a complex formula task.

33. What are the types of functions available in Excel?


There are nine types of functions available in Excel.
1. Financial functions Date and Time functions
1. Math and Trigonometry functions
2. Database functions
SYED AMMAL ENGINEERING COLLEGE
(An ISO 9001: 2008 certified Institution)
Dr. E.M.AbdullahCampus,Ramanathapuram – 623 502.
Department of Computer Science and Engineering
3. Statistical functions
4. Text functions
5. Lookup Reference functions
6. Logical functions
7. Information functions

34. What is a Label?


A label is the name describing the each column and row of a cell. It appears at the left and the
top of a cell.

UNIT IV
INTRODUCTION TO C

1. What are the different data types available in „C‟?


There are four basic data types available in „C‟.
1. int
2. float
3. char
4. double

2. What are Keywords?


Keywords are certain reserved words that have standard and pre-defined meaning in C‟. These
keywords can be used only for their intended purpose.

3. What is an Operator and Operand?


An operator is a symbol that specifies an operation to be performed on operands.
Example: *, +, -, / are called arithmetic operators.
The data items that operators act upon are called operands.
Example: a+b; In this statement a and b are called operands.

4. What is Ternary operators or Conditional operators?


Ternary operators is a conditional operator with symbols ? and :
Syntax: variable = exp1 ? exp2 : exp3
If the exp1 is true variable takes value of exp2. If the exp2 is false, variable takes the value of
exp3.

5. What are the Bitwise operators available in C?


1. & - Bitwise AND
2. | - Bitwise OR
3. ~ - One‟s Complement
4. >> - Right shift
5. << - Left shift
6. ^ - Bitwise XOR are called bit field operators
Example: k=~j; where ~ take one‟s complement of j and the result is stored in k.

6. What are the logical operators available in „C‟?


The logical operators available in „C‟ are
1. && - Logical AND
SYED AMMAL ENGINEERING COLLEGE
(An ISO 9001: 2008 certified Institution)
Dr. E.M.AbdullahCampus,Ramanathapuram – 623 502.
Department of Computer Science and Engineering
2. || - Logical OR
3. ! - Logical NOT

7. What is the difference between Logical AND and Bitwise AND?


Logical AND (&&): Only used in conjunction with two expressions, to test more than one
condition. If both the conditions are true the returns 1. If false then return 0.
Bitwise AND (&): Only used in Bitwise manipulation. It is a unary operator.

8. What is the difference between „=‟ and „==‟ operator?


Where = is an assignment operator and == is a relational operator.
Example:
while (i=5) is an infinite loop because it is a non zero value and while (i==5) is true only when
i=5.

9. What is type casting?


Type casting is the process of converting the value of an expression to a particular data type.
Example:
int x,y;
c = (float) x/y; where a and y are defined as integers. Then the result of x/y is converted into
float.

10. What is conversion specification?


The conversion specifications are used to accept or display the data using the INPUT/OUTPUT
statements.

11. What is the difference between „a‟ and “a”?


„a‟ is a character constant and “a” is a string.

12. What is the difference between if and while statements


if while
(i) It is a conditional statement (i) It is a loop control statement
(ii) If the condition is true, it (ii) Executes the statements within
executes some statements. the while block if the condition is
true.
(iii) If the condition is false then it (iii) If the condition is false the
stops the execution the statements. control is transferred to the next
statement of the loop.

13. What is the difference between while loop and do…while loop?
In the while loop the condition is first executed. If the condition is true then it executes the body
of the loop. When the condition is false it comes of the loop. In the do…while loop first the
statement is executed and then the condition is checked. The do…while loop will execute at least
one time even though the condition is false at the very first time.
14. What is a Modulo Operator?
„%‟ is modulo operator. It gives the remainder of an integer division
Example:
SYED AMMAL ENGINEERING COLLEGE
(An ISO 9001: 2008 certified Institution)
Dr. E.M.AbdullahCampus,Ramanathapuram – 623 502.
Department of Computer Science and Engineering
a=17, b=6. Then c=%b gives 5.

15. How many bytes are occupied by the int, char, float, long int and double?
int - 2 Bytes char - 1 Byte float - 4 Bytes long int - 4 Bytes double - 8 Bytes

16. What are the types of I/O statements available in „C‟?


There are two types of I/O statements available in „C‟.· Formatted I/O Statements · Unformatted
I/O Statements

17. What is the difference between ++a and a++?


++a means do the increment before the operation (pre increment)
a++ means do the increment after the operation (post increment)
Example:
a=5;
x=a++; /* assign x=5*/
y=a; /*now y assigns y=6*/
x=++a; /*assigns x=7*/

18. What is a String?


String is an array of characters.

19. What is a global variable?


The global variable is a variable that is declared outside of all the functions. The global variable
is stored in memory, the default value is zero. Scope of this variable is available in all the
functions.

20. What are the Escape Sequences present in „C‟


1. \n - New Line
2. \b - Backspace
3. \t - Form feed
4. \‟ - Single quote
5. \\ - Backspace
6. \t - Tab
7. \r - Carriage return
8. \a - Alert
9. \” - Double quotes

21. Construct an infinite loop using while?


while (1)
{
}
Here 1 is a non zero, value so the condition is always true. So it is an infinite loop.
SYED AMMAL ENGINEERING COLLEGE
(An ISO 9001: 2008 certified Institution)
Dr. E.M.AbdullahCampus,Ramanathapuram – 623 502.
Department of Computer Science and Engineering

22. What will happen when you access the array more than its dimension?
When you access the array more than its dimensions some garbage value is stored in the array.

23. Write the limitations of getchar( ) and sacnf( ) functions for reading strings (JAN 2009)
getchar( )
To read a single character from stdin, then getchar() is the appropriate.
scanf( )
scanf( ) allows to read more than just a single character at a time.

24. What is the difference between scanf() and gets() function?


In scanf() when there is a blank was typed, the scanf() assumes that it is an end. gets() assumes
the enter key as end. That is gets() gets a new line (\n) terminated string of characters from the
keyboard and replaces the „\n‟ with „\0‟.

25. What is a Structure?


Structure is a group name in which dissimilar data‟s are grouped together.

26. What is meant by Control String in Input/Output Statements?


Control Statements contains the format code characters, specifies the type of data that the user
accessed within the Input/Output statements.

27. What is Union?


Union is a group name used to define dissimilar data types. The union occupies only the
maximum byte of the data type. If you declare integer and character, then the union occupies
only 2 bytes, whereas structure occupies only 3 bytes.

28. What is the output of the programs given below?


main() main()
{{
float a; float a;
int x=6, y=4; int x=6, y=4;
a=x\y; a=(float) x\y;
printf(“Value of a=%f”, a); printf(“Value of a=%f”,a);
}}
Output: Output:
1. 1.500000

29. Declare the Structure with an example?


struct name
{
char name[10];
SYED AMMAL ENGINEERING COLLEGE
(An ISO 9001: 2008 certified Institution)
Dr. E.M.AbdullahCampus,Ramanathapuram – 623 502.
Department of Computer Science and Engineering
int age;
float salary;
} e1, e2;

30. Declare the Union with an example?


union name
{
char name[10];
int age;
float salary;
} e1, e2;

31. What is the output of the following program when, the name given with spaces?
main()
{
char name[50];
printf(“\n name\n”); scanf(“%s, name); printf(“%s”,name);
}
Output:
Lachi (It only accepts the data upto the spaces)

32. What is the difference between while(a) and while(!a)?


while(a) means while(a!=0)
while(!a) means while(a==0)

33. Why we don‟t use the symbol „&‟ symbol, while reading a String through scanf()?
The „&‟ is not used in scanf() while reading string, because the character variable itself specifies
as a base address.
Example: name, &name[0] both the declarations are same.

34. What is the difference between static and auto storage classes?
Static Auto
Storage Memory Memory
Initial value Zero Garbage value
Scope Local to the block in which Local to the block in
the variables is defined which the variable is
Value of the variable defined.
Life persists between different The block in which the
function calls. variable is defined.

35. What is the output of the program?


SYED AMMAL ENGINEERING COLLEGE
(An ISO 9001: 2008 certified Institution)
Dr. E.M.AbdullahCampus,Ramanathapuram – 623 502.
Department of Computer Science and Engineering
main() increment()
{{
increment(); static int i=1;
increment(); printf(“%d\n”,i)
increment();
}
OUTPUT:
123
i=i+1;
}
36. Why header files are included in „C‟ programming?
· This section is used to include the function definitions used in the program.
· Each header file has „h‟ extension and include using ‟# include‟ directive at the beginning of a
program.

37. List out some of the rules used for „C‟ programming.
· All statements should be written in lower case letters. Upper case letters are only for symbolic constants.
· Blank spaces may be inserted between the words. This improves the readability of statements.
· It is a free-form language; we can write statements anywhere between „{„ and „}‟. a = b + c;
d = b*c;
(or)
a = b+c; d = b*c;
· Opening and closing braces should be balanced.
38. Define delimiters in „C‟.

Delimiters Use

: Colon Useful for label


; Semicolon Terminates Statement
()[] Parenthesis Square Used in expression and functions
{} Bracket Curly Brace Used for array declaration Scope
# Hash of statement Preprocessor
, Comma directive Variable Separator

39. What do you mean by variables in „C‟?


· A variable is a data name used for storing a data value.
· Can be assigned different values at different times during program execution.
· Can be chosen by programmer in a meaningful way so as to reflect its function in the program.

40. List the difference between float and double datatype.

S No Float Double Float / Double


1 Occupies 4 bytes in memory Occupies 8 bytes in memory
2 Range : 3.4 e-38 to 3.8e+38 Range : 1.7 e-308 to 1.7e+308
3 Format Specifier: % f Format Specifier: % lf
4 Example : float a; Example : double y;
There exists long double having
a range of 3.4 e -4932 to 3.4 e
+4932 and occupies 10 bytes in
SYED AMMAL ENGINEERING COLLEGE
(An ISO 9001: 2008 certified Institution)
Dr. E.M.AbdullahCampus,Ramanathapuram – 623 502.
Department of Computer Science and Engineering
memory.
Example: long double k;

41. Differentiate break and continue statement


S No break continue
1 Exits from current block / loop Loop takes next iteration
2 Control passes to next statement Control passes to beginning of loop
3 Terminates the program Never terminates the program

42. List the types of operators.


S Operators Types Symbolic Representation
No
1 Arithmetic operators = , - , * , / and %
2 Relational operators > , < , == , >=, <= and !=
3 Logical operators && , || and !
4 Increment and Decrement ++ and –
5 operators =,+=,-=,*=,/=,^=
6 Assignment operators ,;=,&=
7 Bitwise operators Comma & , | , ^ , >> , << , and ~
8 operator Conditional ,
operator ?:

43. Distinguish between while..do and do..while statement in C. (JAN 2009)


While..DO DO..while
(i) Executes the statements within the (i) Executes the statements within the
while block if only the condition is while block at least once.
true.
(ii) The condition is checked at the (ii) The condition is checked at the
starting of the loop end of the loop

44. What is a loop control statement?


Many tasks done with the help of a computer are repetitive in nature. Such tasks can be done
with loop control statements.

49. What are global variable in „C‟?


· This section declares some variables that are used in more than one function. such variable are
called as global variables.
· It should be declared outside all functions.
SYED AMMAL ENGINEERING COLLEGE
(An ISO 9001: 2008 certified Institution)
Dr. E.M.AbdullahCampus,Ramanathapuram – 623 502.
Department of Computer Science and Engineering

50. Write short notes about main ( ) function in ‟C‟ program. (MAY 2009)
o Every C program must have main ( ) function.
o All functions in C, has to end with „( )‟ parenthesis.
o It is a starting point of all „C‟ programs.
o The program execution starts from the opening brace „{„ and ends with closing
brace „}‟, within which executable part of the program exists.

UNIT V
FUNCTIONS AND POINTERS

1. What is meant by Recursive function?


If a function calls itself again and again, then that function is called Recursive function.

2. What is an array?
An array is a group of similar data types stored under a common name.
int a[10];
Here a[10] is an array with 10 values.

3. What is a Pointer? How a variable is declared to the pointer? (MAY 2009)


Pointer is a variable which holds the address of another variable.
Pointer Declaration:
datatype *variable-name;
Example:
int *x, c=5;
x=&a;

4. What are the uses of Pointers?


· Pointers are used to return more than one value to the function
· Pointers are more efficient in handling the data in arrays
· Pointers reduce the length and complexity of the program
· They increase the execution speed
· The pointers saves data storage space in memory

5. What is the output of the program?


main() junk(int i, int j)
{{
int i=5;j=2; i=i*j; junk(i,j); j=i*j; printf(“\n %d %d”,i,j); }
}
Output:
SYED AMMAL ENGINEERING COLLEGE
(An ISO 9001: 2008 certified Institution)
Dr. E.M.AbdullahCampus,Ramanathapuram – 623 502.
Department of Computer Science and Engineering
1. 2
2.

6. What are * and & operators means?


„*‟ operator means „value at the address‟
„&‟ operator means „address of‟

7. What is meant by Preprocessor?


Preprocessor is the program, that process our source program before the compilation.

8. How can you return more than one value from a function?
A Function returns only one value. By using pointer we can return more than one value.

9. Is it possible to place a return statement anywhere in ‘C’ program?


Yes. The return statement can occur anywhere.

10. What are the main elements of an array declaration?


· Array name
· Type and
· Size

11. List the header files in ‘C’ language.


<stdio.h> contains standard I/O functions
<ctype.h> contains character handling functions
<stdlib.h> contains general utility functions
<string.h> contains string manipulation functions
<math.h> contains mathematical functions
<time.h> contains time manipulation functions

12. What are the steps involved in program development life cycle?
1. Program Design
2. Program Coding
3. Program Testing & Debugging

13. What are the types of errors occurred in C program?


1. Syntax errors
2. Runtime errors
3. Logical errors
4. Latent errors

14. What is testing?


Testing is the process of executing the program with sample or tested data.
SYED AMMAL ENGINEERING COLLEGE
(An ISO 9001: 2008 certified Institution)
Dr. E.M.AbdullahCampus,Ramanathapuram – 623 502.
Department of Computer Science and Engineering

15. What are the types of testing?


· Human testing
· Computer based testing

16. How do you define enumerated data type?


enum mar_status
{ single,married,widow };
enum mar_status person1,person2;
person1=married;
Here the person1 is assigned to value zero.

17. What is meant by debugging?


Debugging is the process of locating and isolating the errors.

18. Specify any five syntax error messages.


· Missing semicolon
· Missing braces
· Missing quotes
· Improper comment characters
· Undeclared variables

19. What are the pre-processor directives?


· Macro Inclusion
· Conditional Inclusion
· File Inclusion

20. What is dynamic memory allocation?


Allocating the memory at run time is called as dynamic memory allocation.

21. What are the various dynamic memory allocation functions?


malloc() - Used to allocate blocks of memory in required size of bytes.
free() - Used to release previously allocated memory space.
calloc() - Used to allocate memory space for an array of elements.
realloac() - Used to modify the size of the previously allocated memory space.

22. What is the deference between declaring a variable and defining a variable?
· Declaring a variable means describing its type to the compiler but not allocating any space for
it.
· Defining a variable means declaring it and also allocating space to hold the variable. A variable

23. Why does n++ execute than n=n+1?


SYED AMMAL ENGINEERING COLLEGE
(An ISO 9001: 2008 certified Institution)
Dr. E.M.AbdullahCampus,Ramanathapuram – 623 502.
Department of Computer Science and Engineering
The expression n++ requires a single machine instruction such as INR to carry out the increment
operation whereas; n+1 requires more instructions to carry out this operation.

24. Why is it necessary to give the size of an array in an array declaration?


When an array is declared, the compiler allocates a base address and reserves enough space in
the memory for all the elements of the array. The size is required to allocate the required space.
Thus, the size must be mentioned.
25. Where in memory are variables stored?
Variables can be stored in several places in memory, depending on their lifetime.
(1) Variables that are defined outside any function (whether of global or file static scope), and
variables that are defined inside a function as static variables, exist for the lifetime of the
program‟s execution. These variables are stored in the data segment. The data segment is a
fixed-size area in memory set aside for these variables.
(2) Variables that are the arguments functions exist only during the execution of that function.
These variables are stored on the stack. The stack is an area of memory that starts out as small
and grows automatically up to some predefined limit.
(3) The third area is the one that does not actually store variables but can be used to store data
pointed to by variables. Pointer variables that are assigned to the result of a call to the function
malloc() contain the address of a dynamically allocated area of memory. This memory is in an
area called the heap.

26. What is an heap memory?


The heap is another area that starts out as small and grows, but it grows only when the
programmer explicitly calls malloc() or other memory allocation functions, such as calloc(). The
heap can share a memory segment with either the data segment or the stack, or it can have its
own segment, it all depends on the compiler options and operating system. The heap, like the
stack, has a limit on how much it can grow, and the same rules apply as to how that limit is
determined.

27. What is the difference between an array and pointer?


. Array Pointer
1.Array allocates space 1.Pointer is explicitly assigned to
automatically. point to
2.It cannot be resized. an allocated space.
3.It cannot be reassigned. 2.It can be resized using realloc ().
4.Size of(array name) gives the 3.Pointers can be reassigned.
number of bytes occupied by the 4.Sezeof(pointer name) returns the
array. number of bytes used to store the
pointer variable.
SYED AMMAL ENGINEERING COLLEGE
(An ISO 9001: 2008 certified Institution)
Dr. E.M.AbdullahCampus,Ramanathapuram – 623 502.
Department of Computer Science and Engineering
28. What is the purpose of the function main()? (MAY 2009)
The function main () invokes other functions within it. It is the first function to be called when
the program starts execution. Some salient points about main() are as follows:
1. It is the starting function .
2. It returns an int value to the environment that called the program.
3. Recursive call is allowed for main() also.
4. It is a user-defined function.
5. Program exection ends when the closing brace of the function main() is reached.
6. It has two arguments (a) argument count and (b)argument vector (reprensents strings passed.)
7. Any user-defined name can also be used as parameters for main() instead of argc and argv

28. What is dangling pointer?


In C, a pointer may be used to hold the address of dynamically allocated memory. After this
memory is freed with the free() function, the pointer itself will still contain the address of the
released block. This is referred to as a dangling pointer. Using the pointer in this state is a serious
programming error. Pointer should be assigned NULL after freeing memory to avoid this bug.

29. Compare arrays and structures.


Comparison of arrays and structures is as follows.

Arrays Structures
An array is a collection of data items of same A structure is a collection of data items of
data type. different data types.
Arrays can only be declared. Structures can be declared and defined.
There is no keyword for arrays. The deyword for structures is struct.
An array name represents the address of the A structrure name is known as tag. It is a
starting element. shorthand notation of the declaration.
An array cannot have bit fields. A structure may contain bit fields.

30. Is it better to use a macro or a function?


Macros are more efficient (and faster) than function, because their corresponding code is inserted
directly at the point where the macro is called. There is no overhead involved in using a macro
like there is in placing a call to a function.
However, macros are generally small and cannot handle large, complex coding constructs. In
cases where large, complex constructs are to handled, functions are more
suited, additionally; macros are expanded inline, which means that the code is replicated for each
occurrence of a macro.

31. List the characteristics of Arrays.


All elements of an array share the same name, and they are distinguished form one another with
help of an element number. Any particular element of an array can be modified separately
without disturbing other elements.
SYED AMMAL ENGINEERING COLLEGE
(An ISO 9001: 2008 certified Institution)
Dr. E.M.AbdullahCampus,Ramanathapuram – 623 502.
Department of Computer Science and Engineering
32. What are the types of Arrays?
1.One-Dimensional Array
2. Two-Dimensional Array
3. Multi-Dimensional Array

33. What is the use of ‘\0’ character?


When declaring character arrays (strings), „\0‟ (NULL) character is automatically added
at end. The „\0‟ character acts as an end of character array.

34. Define sscanf() and sprint() functions.


The sscanf(): This function allows to read character from a character Array and writes to another
array. Similar to scanf(), but instead of reading from standard input, it reads from an array.
The sprintf(): This function writes the values of any data type to an array of characters.

35. Define Strings.


Strings: The group of characters, digit and symnbols enclosed within quotes is called as Stirng
(or) character Arrays. Strings are always terminated with „\0‟ (NULL) character. The compiler
automatically adds \0 at the end of the strings.
Example:
char name[]={„C‟,‟O‟,‟L‟,‟L‟,‟E‟,‟G‟,‟E‟,‟E‟,‟\0‟};

36. What is the use of ‘typedef’’?


It is used to create a new data using the existing type.
Syntax: typedef data type name;
Example:
typedef int hours: hours hrs;/* Now, hours can be used as new datatype */

37. What is ‘C’ functions? Why they are used?


A function is a self-contained block (or) a sub-program of one or more statements that performs
a special task when called. To perform a task repetitively then it is not necessary to re-write the
particular block of the program again and again. The function defined can be used for any
number of times to perform the task.

38. Differentiate library functions and User-defined functions.


Library Functions User-defined Functions
a) Library functions are pre-defined a) The User-defined functions are the
set of functions that are defined in C functions defined by the user
libraries. according to his/her requirement.
b) User can only use the function but b) User can use this type of function.
cannot change (or) modify this User can also modify this function.
function.
SYED AMMAL ENGINEERING COLLEGE
(An ISO 9001: 2008 certified Institution)
Dr. E.M.AbdullahCampus,Ramanathapuram – 623 502.
Department of Computer Science and Engineering
39. What is a use of ‘return’ Keyword?
The „return‟ Keyword is used only when a function returns a value.

40. Classify the functions based on arguments and return values.


Depending on the arguments and return values, functions are classified into four types.
a) Function without arguments and return values.
b) Function with arguments but without return values.
c) Function without arguments but with return values.
d) Function with arguments and return values.

41. Distinguish between Call by value Call by reference.


Call by value Call by reference.
a) In call by value, the value of actual a) In call by reference, the address of
agreements is passed to the formal actual argurment values is passed to
arguments and the operation is done on formal argument values.
formal arguments. b)Formal arguments values are pointers
b) Formal arguments values are to the actual argument values.
photocopies of actual arguments values. c) Since Address is passed, the changes
c) Changes made in formal arguments made in the both arguments values are
valued do not affect the actual permanent.
arguments values.

You might also like