0% found this document useful (0 votes)
27 views

BSC Istyear

Uploaded by

lavarajugadi
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views

BSC Istyear

Uploaded by

lavarajugadi
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 93

PC SOFTWARE & “C” PROGRAMMING 1

1. EXPLAIN ABOUT BLOCK DIAGRAM OF A COMPUTER?

Computer comes from the word compute which means calculate. Computer is an electronic device

which is used to process data and store it and retrieve it whenever it is necessary. It is used to add,

subtract, multiply, divide, move, and perform other mathematical and logical functions on numbers.

Memory unit
INPUT unit OUTPUT unit
Control unit

ALU

Central processing unit

A computer can be build to process an algorithm. The basic operations of a computer are

 Input data: is used to enter data and instruction into a computer

 Storing data: used to save data and instructions for later use

ALU perform arithmetic operation, logical operations on a data



 Output unit: used to translate the machine code to human readable form

Control unit control the devices connected to a computer



Computer consists of three parts namely Input unit, output unit, CPU

Input Unit: Reads the list of instructions and data from the user and converts these instructions to

machine readable form. Ex keyboard, mouse

Central processing unit: Central processing units (CPU) that fetch decode and execute instructions.

It contains three parts 1.memory unit 2.control unit 3.Arithmetic and logical unit

Memory Unit:- It is used to store instructions, data processed by a processor. The stored data can

be retrieved when ever it is necessary. There are two types of memories Primary memory and

secondary memory

Primary memory: it is used to store data temporarily. It is a volatile memory

Secondary memory: it is used to store data permanently. It is non volatile memory

Control unit: control unit control all other units in the computer.

Arithmetic and logical unit: Arithmetic logic unit (ALU) is a digital circuit that performs arithmetic

operations like addition (+), subtraction (-), multiplication (*), and logical operations such as

comparison i.e. less than (<) greater then (>) less than or equal to (<=) greater than or equal to (>=)

equal to (==) and not equal to (! =)

Output Unit:-It is used to display the results of a computer. It is used to translate the machine

readable form of a data to human readable form of a data. Example monitor, printer etc

PC SOFTWARE & “C” PROGRAMMING


PC SOFTWARE & “C” PROGRAMMING 2

2. WHAT ARE THE COMPONENTS OF THE COMPUTER?

There are two types of components in a computer. They are hardware and software

Hardware: it is a collection of physical components. Example: keyboard, monitor etc

Software: it is a collection of programs or collection of instructions or collection of statements

3. WHAT ARE THE CHARACTERISTICS OF A COMPUTER?

1. Speed: Computer works at a great speed. It can process data at microseconds (i.e.10-6

seconds). Some advanced computers can process at Nano (10-9 seconds) and Pico (10-12

seconds).

2. Accuracy: it can process or evaluate complicated instruction with 100% accuracy.

3. Storage: large amount of data can be store temporarily or permanently in the system. Using

secondary store devices the data stored permanently.

4. Diligence: system can work for a long time with out tiredness

5. size and cost: day by day the size and cost of a computer is reduced

6. Retrieval: it can retrieve the required information from the permanent storage devices with great

speed and accuracy.

7. Versatility: They can do various types of processing such as word-processing graphics,

mathematical calculations and logical comparisons, tabular information processing, data

processing, file maintenance etc.

8. Computer is used to communicate different systems which are connected in a network.

9. networking is used to connect different types of system in a single network to share the resources

and provide central data administration

4. EXPLAIN THE CLASSIFICATION OF COMPUTERS?

Computers can be classified in the following way

1. Based on the mechanism 2.Based on the purpose of usage 3.Based on the size

Based on the mechanism it can be classified as

1. Analog computers 2. Digital computers 3. Hybrid computers

1. Analog computers: Analog computers are used to measure physical quantities like pressure,

length, temperature etc., and convert them to numeric values. It receives the input in the form of a

sine wave. They are used mainly for scientific and engineering purposes because they deal with

quantities that vary constantly. They give only approximate results.

2. Digital computers: Digital computers are used to compute the numerical values. It is used in

offices, colleges, industries and companies etc. it receive a square wave as an input. It represents a

PC SOFTWARE & “C” PROGRAMMING


PC SOFTWARE & “C” PROGRAMMING 3

high +5 volts and a low –5 volts as a data. They are used to process numbers, letters and other

special characters. There are some special purpose digital computers that are designed to perform

specific tasks.

3. Hybrid computers: A Hybrid computer is having both the Analog and Digital computers. These

types of computers are mainly used in Hospitals. For example analog computer can measure a

patient’s temperature, heart functions etc. These are then converted into numbers and supplied to the

digital components that monitor the patient’s status.

Based on the purpose of usage: It can be classified as general purpose and special purpose

computers. The general purpose computers are run different types of applications common to all

users. Special purpose computers are used for a specific type of application

Based on size the computers are classified into four types

They are 1. Micro computer 2. Mini computer

3. Mainframe computer 4. Super computer

1. Micro computers: The microcomputer is the smallest type of computer available. Inside a

microcomputer, the arithmetic and control unit are combined on a single chip called a Microprocessor.

The first microprocessor chip was invented by Dr. Ted Hoff of Intel Corporation (U.S.A.) in 1969 it can

be used as personal computers

2. Mini computer: The first popular minicomputer was the pdp-8, launched in 1965.these computers

are more powerful than the microcomputers and can support several users. They have larger RAM

and storage capacity and quickly process large volume of data. They are used in process control

systems.

3. Mainframes: Mainframes are very large computers having high processing speed and storage

capacity. It can be used in banks and insurance companies. It can process several million

transactions per second. These computers are much bigger in their size and more expensive.

4. Super computers: Super computers are very large computer connected to hundred of terminal

computers. It can process most complicated data at high speed and accuracy. They are mainly used

for research work. India produces its own super computer names Param

5. EXPLAIN ABOUT GENERATIONS OF COMPUTERS?

Each generation has many changes in the characteristics of a computer like speed, accuracy,

diligent, storage etc. these changes are called as generations. There are five generation in computers

they are

PC SOFTWARE & “C” PROGRAMMING


PC SOFTWARE & “C” PROGRAMMING 4

First generation Second generation Third generation



Fourth generation Fifth generation

First generation: 1949-55: In this generation vacuum tubes are used as electronic components. It

was the only device used for performing computing in these days

Limitations

1. the speed of a computer is very low

2. it consumes log of power

3. it generates lo of heat

4. time span is very less

5. air conditioners should be required

6. the data stored on vacuum tubes should be refreshed regularly

7. input and output operations are performed by using punched cards

Second generation This generation is from 1955-1964. This generation transistor are used as an

electronic components

Limitations:

1. the size of a transistor is smaller than the vacuum tubes

2. batch operating system is introduced

3. it consumes less power and generate less heat

4. the operating speed is very high

5. major advantage is that the size of the computer is reduces

6. the cost of a computer is also reduced

7. input and output operations are performed by using punched cards

8. for external storage magnetic tapes are used

Third generations 1964-1975 In this generation large scale integrated circuit are used as electronic

components. This generation has made various changes to store data and process data

Limitations

1. the size of a computer is reduced

2. time sharing operating system is introduced

3. the performance is between than that of transistor

4. input and output operations are performed by using keyboard, monitor

PC SOFTWARE & “C” PROGRAMMING


PC SOFTWARE & “C” PROGRAMMING 5

5. for external storage magnetic disks are used

6. cost, power consumption and hear production is reduced

7. speed , accuracy and diligent features of a computer in increased

Fourth generation: In this generation very large scale integrated circuits (VLSIC) are used as an

electronic component

Limitations

1. low cost

2. Distributed systems, integrated CAD/CAM real time control, GUI systems are introduced

3. low reliability 4. low maintenance

5. the size of a computer is reduced

6. input and output operations are performed by using keyboard, monitor, printer etc

7. for external storage magnetic discs magnetic tapes, CD, DVD are used

8. in this generation microcomputer has become more popular

Fifth generation: In this generation optical fibers are used as electronic components. Artificial

intelligence is used to design the logic. These computers are still under research work. They are used

in robotic technology to automate various physical devices

6. EXPLAIN ABOUT VARIOUS TYPES OF INPUT DEVICES?

Input devices are used to accept the information from the user. It can be user understandable

language. There are different types of input devices to accept the information from the user. The input

devices are

Punched cards, keyboard, joystick, mouse etc

Punched cards: it contains rows and columns. These cards are kept in a punched machine which

makes holes on the cards to represent the data. The punched cards are cheaper but they are not

reusable

Keyboard: It is a standard input device. It contains all keys that are present in type writer. Generally

keyboards are two types they are standard keyboard and enhanced keyboard

Standard keyboard: it contains 80/101 keys and receives 16 characters /second (16CPS)

 Enhanced keyboard: it contains more than 130 keys and receives 100characters/second (100

CPS)

A standard computer keyboard contains

PC SOFTWARE & “C” PROGRAMMING


PC SOFTWARE & “C” PROGRAMMING 6

 Alphanumeric keys (a to z)

 Numeric keypad (0 to 9)

Function keys (f1 to f12)



 Special keys (esc, ins, del, pgup, pgdn, home etc)

 Cursor-movement keys (left, right, up, down)

When you press a key the keyboard controller detects the keystroke and places a scan code in the

keyboard buffer, indicating which key was pressed. The keyboard sends the computer an interrupt

request, telling the CPU to accept the keystroke

Mouse: Mouse is a graphical input device. It is also called as pointing device. It contains a ball which

spins the roller in mouse to move the pointer on screen. Mouse is having 2 or 3 buttons which are

used to select application, drag and drop the applications on windows desktop.

Trackballs: Trackball is like a mouse turned upside-down. It can be operated by thumb to move the

exposed ball to select an application

Light Pens: Light pen is also called as stylus which is used to write on the screen and choose

commands. It is used to design most complicated circuits, write comments on an image etc. It is

mostly used in CAD/CAM purpose

Touch Screens: Touch-screen systems accept input directly through the monitor. The sensors of a

touch screens detect the touch of a finger. They are useful where environmental conditions prohibit

the use of a keyboard or mouse. It is used for selecting options from menus. it is widely used in ATM,

information centre like railways, departmental stores etc.

Joystick: it is a popular input device used for playing video games. It is used to control object

OMR: (optical mark reader): It is a device that works on the light technology. It is used to process

competitive examination papers.

OCR optical character reader: It is also knows as scanner. It can be used to scan the characters,

photos, images using Optical character recognition (OCR) software to translate scanned text into

editable electronic documents

Bar Code Readers: Bar code readers used to read printed bar codes to identify the product. The

reader emits light, which reflects off the bar code. A light sensitive detector identifies the bar code

image by recognizing special bars at both ends of the image. Example Books, pens, telephone bills

etc

MICR magnetic ink character recognizer: This device is used in baking sectors for processing

checks

PC SOFTWARE & “C” PROGRAMMING


PC SOFTWARE & “C” PROGRAMMING 7

Microphones and Speech Recognition: It is used to receive audio input and translate it in to digital

signals. It requires a sound card in the PC to record signals

Video Input or web cam: Applications like video conferencing and video chat needs video files to be

communicated between computers.

7. EXPLAIN ABOUT VARIOUS OUTPUT DEVICES? OR EXPLAIN DIFFERENT TYPES OF

PRINTER?

Out put devices are used to convert the machine readable form of data to a human readable data.

Monitor: it is a visual display unit (VDU). Monitor is the standard output device to display the

information on the screen. It looks like television screen. It has Cathode ray tube CRT to display

information. The monitors are divided into two types they are 1. Monochrome monitor and color

monitor. Monochrome monitor can display single color and color monitor can display 16 color to

million of colors

Liquid Crystal Display (LCD): LCD was introduced in the 1970s and. The advantages of LCD are

low energy consumption, smaller and lighter.

Printers:-

There are two types of printers 1) Impact printers. 2) Non-Impact printers

Impact printers: there is a physical contact between printer head and printer media

Example: dot-matrix printer

Non impact printer: there is no physical contact between printer head and print media example:

laser printer

Dot matrix printer: A dot matrix printer is a computer printer with a print head striking the ribbon

against the paper to print the image or characters.

Inkjet printers: It is non impact printer. It sprays small droplets of ink onto paper to create an image.

It produces high quality output

Laser Printers A laser beam projects an image of the page to be printed onto an electrically charged

rotating drum coated with selenium. Photoconductivity removes charge from the areas exposed to

light. Dry ink (toner) particles are then electro statically picked up by the drum's charged areas. The

drum then prints the image onto paper by direct contact and heat, which fuses the ink to the paper.

Drum Printers:- Drum printer consists of a cylindrical drum. The characters to be printed are

embossed on its surface. The printer drum is rotated at a high speed. One complete set of characters

is embossed for each and every print position on a line. The drum would have to complete one full

PC SOFTWARE & “C” PROGRAMMING


PC SOFTWARE & “C” PROGRAMMING 8

revolution for a line to be printed. This is called on the fly printing as the drum continues to rotate at a

high speed when the hammer strikes it.

Chain Printers:-A chain printer has a steel band on which the character sets are embossed for

printing a line; all the characters in the line are sent from the memory to the printers buffer register.

The hand is rotated at a high speed.

Serial Printers:-Serial printers print one character at a time, with the print head moving a cross a

line. The most popular serial printers is called a dot matrix printer characters to be printed are sent

one character at a time from the memory to the printer. Many dot matrix printers are directional,

which is they print from left to write as well as print from right to left return. Thus speeds up printing

character printers are less expensive.

Letter Quality Printers:-Ink jet printer is used for output where characters are represented by sharp

continuous lines. It consists of a print head which has a number of holes. Electronic system selects

the holes to be heated based on the character to be printed. The printing speed of ink jet printers is

around 120 characters per second and can draw figures besides printing text.

Line printers: It is an impact printer. It is used to print one line at a time. It is very high speed printers

used in banks.

Dye diffusion thermal transfer: Also known as thermal dye sublimation, dye sub, or thermal dye

transfer, this is a process used by color printers. A colored wax film or crayon is moved across the

page. The pigment is heated and deposited on the page. The paper frequently goes through the

printer four times, one time for each color.

Speaker: It is used to convert digital signals to audio signals. It converts the signals by using a sound

card in the computer

Plotter: A plotter is a vector graphics printing device that connects to a computer. Plotters print their

output by moving a pen across the surface of a piece of paper. It is used for line art, including text.

Plotters are used to generate high quality technical drawings

EXPLAIN THE CLASSIFICATION OF PRIMARY MEMORY?

Primary memory can be divided in to two types they are

1. Volatile Memory 2 Non-Volatile Memory.

Volatile memory: The information is a volatile memory is lost when power switched off. A semi-

conductor random access memory (RAM) is an example of volatile memory

Non volatile memory: The information stored in non volatile memory is permanent. A semiconductor

ROM is a non-volatile memory. It is used to store programs which should not be lost when power is

PC SOFTWARE & “C” PROGRAMMING


PC SOFTWARE & “C” PROGRAMMING 9

turned off. A semiconductor memory takes approximately same time to read and write data. It can be

classified as

Static
Ram
Dynamic
Semi - Conductor
Memory Factory Programmed
Rom Non - erasable
Eeprom
User Programmed
Erasable
Uveprom

Ram: classified as static and dynamic ram

Static RAM: Static random access memory (SRAM) is a type of semiconductor memory it does not

need to be periodically refreshed. SRAM uses bi-stable latching circuitry to store each bit. SRAM

exhibits volatile memory if the power is lost the data is lost.

Dynamic RAM: Dynamic random access memory (DRAM) is a type of random access memory that

stores each bit of data in a separate capacitor within an integrated circuit. The capacitors are

refreshed periodically because it leaks the charge. The advantage of DRAM is its only one transistor

and capacitors are required per bit

ROM: classified as Factory Programmed ram and User Programmed

The factory programmed ROM's are manufactured using appropriate tasks. They are most reliable

and also the least expensive.

User programmed ROM's are divided into erasable & Non-Erasable.

Non-Erasable Programmable ROM is programmed using fuse-links.

Erasable PROM's can be erased & reprogrammed by a user.

EEPROM is electrically erasable using high voltage pulses.

UVEPROM is used in development of applications in which data is erased by UV rays

8. WHAT ARE THE SECONDARY STORAGE DEVICES? (OR)WRITE THE CLASSIFICATION OF

SECONDARY STORAGE DEVICES?

It is a non volatile memory deceives. The data store on these devices is not erased even after the

power switch off. The data stored on these devices are permanent. It support high capacity of data

storage used as a backup. It can be classified as 3 types namely magnetic tapes, magnetic disc and

optical disks

Magnetic tapes: It is an external storage device. It contains a tape of size 12.5mm width and 500 to

1200 meters in length. The tape is made by a plastic material “milar” and it is coated with this layer of

iron oxide. This magnetic material can be used to storage & retrieve data. The magnetic tape can be

PC SOFTWARE & “C” PROGRAMMING


PC SOFTWARE & “C” PROGRAMMING 10

divided into 7 to 9 tracks. Each track represents one bit of information. The last track is used to as

parity bit. It is used to find the data transmission errors

Advantages:

1. It is used to store large amount of data

2. It is economical

Disadvantages: 1) Data can be stored in sequential order.

Magnetic Disks: It looks like a gramophone record. It is made by using plastic material “Mylar”

coated with a thin layer of magnetic material. The can be read and write by using magnetic Read

Write head. The data can be stored in random order.

It can be classified as floppy disks and hard disks

Floppy disk:

It is developed in 1870. It is made by using

this plastic material “Mylar” coated with thin

layer of Ferro magnetic material to store data.

It has to be formatted before using it. During

the formatting process the disk is divided into

equal number of tracks and sectors. It can be

available in 3.5 inch 5 ¼ inch etc

Hard disk

Hard disk is made by using a set of “Mylar”

plastic disks or aluminum disks coated with

Ferro magnetic material. The first and the

last surface of the plastic or aluminum

sheets are not coated with magnetic

material. A spindle rotates all the disks at a

time in one direction to access data on disk.

The disk surface can be divided in to equal

number of tracks, sectors and cylinders.

PC SOFTWARE & “C” PROGRAMMING


PC SOFTWARE & “C” PROGRAMMING 11

Each magnetic surface is accessed by a separate Read/Write head. It can be used to store data from

100md to 1 TB

Optical disk: It can be used to store large amount of data. It uses optical mechanism to read and

write data. It can be classified as compact disk, digital versatile disc

Compact disk CD: A Compact Disc (also known as a CD) is an optical disc used to store digital data.

Standard CDs have a diameter of 120 mm and can hold up to 80 minutes of audio (700Mb of Data). A

Compact Disc is made from a 1.2 mm thick disc of almost pure polycarbonate plastic and weighs

approximately 16 grams. A thin layer of aluminum or, more rarely, gold is applied to the surface to

make it reflective, and is protected by a film of lacquer. CD data is stored as a series of tiny

indentations known as “pits”, encoded in a tightly packed spiral track molded into the top of the

polycarbonate layer. The areas between pits are known as “lands”. Each pit is approximately 100 nm

deep by 500 nm wide, and varies from 850 nm to 3.5 µm in length.

Digital versatile disk DVD: DVD (also known as "Digital Versatile Disc" or "Digital Video Disc") is a

popular optical disc storage media format. Its main uses are video and data storage. It is made by

using hard plastic material coated with a thin layer of optical material. It can be used to store 2Mb to

5Mb data

WHAT IS CACHE MEMORY?

The cache is the intermediate between CPU and main memory. It is the high speed memory.

Whenever the CPU needs the data first it finds the cache memory. If it is found then get the data

otherwise find the main memory.

WHAT IS A PROGRAM?

A computer program is a set of statements or instructions used to solve a problem using computer.

WHAT IS SOFTWARE?

A set of programs are called software. Computer software classified into two categories Application

software and system software

Application Software:-Application software is the set of programs necessary to carry out operations

for a specified application.

System Software:-Computer software that maintains and organizes the computer system is called

system software. These Program control and support the operation of a computer system, including

operating systems, database management systems, communications etc., Example Operating

system

WHAT IS A LANGUAGE?

PC SOFTWARE & “C” PROGRAMMING


PC SOFTWARE & “C” PROGRAMMING 12

Language is the communication media between two individuals. Every language is having a well

defined character set and a grammar.

WHAT IS A COMPUTER LANGUAGE?

Computer language is the communication media between user and computer. It is used to write

computer programs to solve a problem using computer. Computer language is having well defined

character set and syntax rules.

WHAT ARE THE CLASSIFICATIONS OF COMPUTER LANGUAGES? (OR)WHAT ARE THE

GENERATIONS OF PROGRAMMING LANGUAGES?

Computers languages are classifies as

1st generation: machine level language

2 generation: assembly level language


nd

3 generation: high level languages like c, c++, FORTRAN, Pascal, COBOL and BASIC
rd

4 generation: front end application programs like java, VB, web applications etc
th

WHAT IS MACHINE LEVEL LANGUAGE?

Machine level language is a language which is written by using ‘1’ and ‘0’. It can be directly executed

by a system. The advantage of the language is it does not require any converter. It is running at very

high speed. The main disadvantage is it is very difficult to debug. It is system dependent

WHAT IS ASSEMBLY LANGUAGE?

it is a language written by using mnemonics. Each computer has its own instruction set defined by

developer depending upon the architecture. It is translated into machine level by using assembler.

The main disadvantage is it is very difficult to debug and upgrade

WHAT IS AN ASSEMBLER?

Assembler is used to convert assembly level language program to machine level program.

WHAT IS A HIGH LEVEL LANGUAGE?

High level language is a language written by using English statements. It is translated into machine

level by using compiler or interpreter. The advantage is very easy to understand, debug and upgrade.

DEFINE OPERATING SYSTEM? WHAT ARE THE FEATURES OF OPERATING SYSTEMS?

Operating system can be defined as an interface between user and hardware. It is used for the

management and coordination of activities and the sharing of the limited resources of the computer

Process Management: It is used to run multiple processes simultaneously on a single processor.

The five major activities process management are

1. Creation and deletion of user and system processes

PC SOFTWARE & “C” PROGRAMMING


PC SOFTWARE & “C” PROGRAMMING 13

2. Suspension and resumption of processes

3. A mechanism for process synchronization

4. A mechanism for process communication

5. A mechanism for deadlock handling

Memory Management: it is used to allocate and de-allocate memory space to each application for

each user. If there is insufficient physical memory, the operating system creates "virtual memory" on

hard disk. The virtual memory used to run applications requiring more memory than available RAM on

the system. It is slower than RAM. The main tasks of memory management are

1. Find which part of memory are currently being used and by whom.

2. Decide which process is loaded into memory when memory space becomes available.

3. Allocate and de-allocate memory space as needed.

Device Management: all the physical devices connected to the system are controlled by using

device driver programs. It is used to access the external devices like all Input output devise

connected to the system. It is also mange and controls the internal devices in a system.

Job management: it is used to run multiple tasks of the same user or different users on a single

system at a time

File Management: A file is a collection of related information defined by its creator A files systems

normally organized into directories to ease their use. These directories may contain files and other

directions.

The five main major activities of an operating system in regard to file management are

 Create and delete files

 create and delete directories

 Manage files and directories

 Storing files on secondary storage devices

 Create and maintain FAT on storage devices

Networking: A distributed system is a collection of processors that do not share memory, peripheral

devices, or a clock. The processors communicate with one another through communication lines

called network. The communication-network design must consider routing and connection strategies,

and the problems of contention and security.

Protection System: If a computer system has multiple users and allows the concurrent execution of

multiple processes, then the various processes must be protected from one another's activities.

Protection refers to mechanism for controlling the access of programs, processes, or users to the

resources defined by computer systems

PC SOFTWARE & “C” PROGRAMMING


PC SOFTWARE & “C” PROGRAMMING 14

WHY DO WE NEED AN OPERATING SYSTEM?

Operating system does two things:

1. It manages the hardware and software resources of the system. In a desktop computer,

these resources include such things as the processor, memory, disk space, etc. (On a cell phone,

they include the keypad, the screen, the address book, the phone dialer, the battery and the network

connection.)

2. It provides a stable, consistent way for applications to deal with the hardware without having

to know all the details of the hardware.

WHAT ARE THE TYPES OF OPERATING SYSTEMS?

Operating system are of 6 types they are real-time, single- user/single-tasking,

single-user/multitasking, multi-user/multitasking and time sharing, real time and online OS

Real-Time Operating Systems: A real-time operating system is a very fast, relatively small OS. It is

used as embedded OS. It is used to implement real time applications which can run multiple tasks

simultaneously or to run single task. It responds to given inputs extremely fast it is used to run

medical diagnostics equipment, life-support systems scientific instruments, and industrial systems.

Single-User/Single/T asking Operating Systems: An operating system that allows a single user to

perform one task at a time is a single-user/single-tasking operating system. MS-DOS is one example

of a single-tasking OS; it consumes very little space on disk or in memory to run the applications

Single-User/Multitasking Operating Systems: A single-user/multitasking operating system single

user can run multiple tasks at a time. Examples are Microsoft Windows and the Macintosh Operating

System. The advantage of this OS is to do more task at a time so the productivity of a user is

increased. The disadvantage of a single-user/multitasking operating system is the increased size and

complexity

Multi-User/Multitasking Operating Systems: In this OS multiple users can share or run multiple

tasks at a time. In this O/S each user can do separate tasks or share the same task to different users

in a network. In a Network when a computer is connected to a server to access document files to

edit, the client computer performs the processing work locally. Each user’s applications run within

their user session on the server separate from all other user sessions. The software that makes this

possible is called a terminal client. Examples of multi-user OS include UNIX, VMS, and mainframe

operating systems

Time sharing operating system: In this OS a group of computer connected as a network. The

server can allocate a fixed amount of time slot to each terminal connected in the network to provide

PC SOFTWARE & “C” PROGRAMMING


PC SOFTWARE & “C” PROGRAMMING 15

the service. If the allotted time is not sufficient then it is served only after completing the service of all

other systems in a network.

Web operating system or online operating system

(1) An operating system that runs in a server on the Web.

(2) The environment created in a user's machine from an online application stored on the Web and

run through a Web browser. For example, when an online suite of office applications is run, it may

present a unique interface to the user, and this operating environment is sometimes referred to as

a Web operating system.

PC SOFTWARE & “C” PROGRAMMING


PC SOFTWARE & “C” PROGRAMMING 16

DOS

EXPLAIN ABOUT VARIOUS DOS COMMANDS?

The DOS commands are divided into two types they are internal and external commands

INTERNAL DOS COMMANDS

Internal DOS commands: these commands can be executed any time after prompt appear on the

screen. Internal commands are part of command.com file. They are

1) Date command: the purpose of this command is to display the system date and allows the user to

enter new date “MM/DD/YY” format

PC SOFTWARE & “C” PROGRAMMING


PC SOFTWARE & “C” PROGRAMMING 17

Example: C:\>date

The Current data is : Fri 10 | 26 | 10

Enter the New data :20 | 14 | 10

2) Time command: The purpose of this command is to display the system time and allows the user

to enter new time “HH:MM:SS” format

Example: C:\> time

The current time is :11:17:02.07

Enter the new time :

3) VER : this command is used to display the version of the DOS

Example: C :\> ver

MS-Dos version is 6.22

4) CLS: this command is used to clear the screen and display the cursor top of the screen

Example: C:\>cls

5) Copy con: the purpose of the command is to create file

Example: C :\> copy con test

This is the Test program

Press F6 or Ctrl + Z to save the file

6) Ren: the purpose of this command is to rename the existing file

Syntax: C:\>ren old file new file

Example: C :\> ren test new test

7) Copy: the purpose of this command is to copy the information from one file to other file

Syntax: C:\>copy oldfile newfile

Example: C:\>copy test newfile

8) Type: the purpose of this command is to display the contents of a file on screen

Syntax: C:\>type filename

Example: C :\> type test

9) Del: the purpose of this command is used to delete the file

Syntax: C:\>del filename

Example: C:\>del test

10) Md (make directory): the purpose of this command is used to create user defined directory

Syntax: C:\md directory name

Example: C:\md bsc

11)Cd change directory: the purpose of this command is used ot change the directory

PC SOFTWARE & “C” PROGRAMMING


PC SOFTWARE & “C” PROGRAMMING 18

Syntax: C:\cd diretory_name

Example: C:\cd bsc

12) cd.. : the purpose of this command is used to return back to the previous directory

Syntax: C:\>cd.. 

Example C :\> cd.. 

13) cd\ : the purpose of this command is to return back to the root directory

Syntax: C:\>cd\

Example C:\mecs\bsc> cd\

14)rd: remove directory the purpose of this command is delete the directory.

Syntax: C:\>rd directory_name

Example C :\> rd bsc

Note: before deleting a directory it must be empty

15) Dir: the purpose of this command is used to display the list o file name and directory name

Syntax: C:\>dir

Example C :\> dir

16) dir/p: this command is used to display the files and directories page by page format

Syntax: C:\>dir /p

Example C :\> dir /p

17)dir/w: this command is used to display the files and directories width wise format

Syntax: C:\>dir /w

Example C :\> dir /w

18) dir/l: this command is used to display the files and directories in lower case format

Syntax: C:\>dir /l

Example C :\> dir /l

19)dir/ad: this command is used to display the directories except files

Syntax: C:\>dir /ad

Example C :\> dir /ad

20) dir/a: this command is used to display the hidden files

Syntax: C:\>dir /a

Example C :\> dir /a

21) dir/a-d: this command is used to display the files except directories

Syntax: C:\>dir /a-d

Example C :\> dir /a-d

PC SOFTWARE & “C” PROGRAMMING


PC SOFTWARE & “C” PROGRAMMING 19

WILD CARDS OPTIONS: there are two types of wild cards in DOS they are * and ?

 * represent any number of characters

 ? represent any one character

Example: c:\>dir a*.c display all c files whose file name starting with a

C:\>dir????.c display all the c files whose file name length is 4

Prompt this command is used to change the prompt name

Example: C:\>prompt rama

Output rama

Example: rama$p$g hear $p represent drive name(C) and $g represent > symbol

Output: C :\>

EXTERNAL DOS COMMANDS: (OR) WRITE ABOUT EXTERNAL DOS COMMANDS

External DOS commands are not included command.com file. They are loaded in memory to execute.

They are

1) Chkdsk: this command is used to check the structures of the disk and repair errors in the

directories

2) Diskcopy: this command is used to copy contents of one disk to other disk

Syntax: C:\> disk copy drive1 drive2

Example: C:\> disk copy a: b: 

Dos display the following message “Insert source disk”

First the disk1 information is stored in RAM and transfer into target disk

Dos display the following message “Insert target disk”

3) Diskcomp: this command is used to compare the information of two disks on tract to tract basis

Syntax: C:\> Diskcomp drive1: drive2: 

Example: C:\> diskcomp a: b: 

4) Tree: this command is used ot display the files and directories in tree structure format

Syntax: C:\>tree

5) Deltree: this command is used to delete the directory including subdirectories and files

Syntax: C :\> deltree directory

Example: C:\>deltree bsc

PC SOFTWARE & “C” PROGRAMMING


PC SOFTWARE & “C” PROGRAMMING 20

6) Mode: this command is used to change the screen width

Syntax: C :\> mode size

Example: C:\>mode 40

7) Attrib: this command is used to apply the attributes one or more files. The attributes are r- read

only w- write only a- archive h-hidden s- system file

Syntax: C :\> attrib mode file

Example: C :\> attrib +h test

8) Find: this command is used to find the given work in a given file

Syntax: C:\>find “word” filename

Example: C:\>find “was” test.txt

9) Edit: this command is used to add or delete or modify files

Syntax: C:\>edit filename

WHAT ARE THE FEATURES OF WINDOWS OPERATING SYSTEM?

Windows is GUI based operating system from Microsoft Corporation. It is multi-user multitasking

operating system. It is user friendly Operating System. It has menu and icon driven interface. This OS

has various versions they are Windows 95, Windows 98, Windows 2000, Windows XP

Features:

 It is a multitasking operating system

 It is user friendly because all the commands are represented in the menu

 It support multimedia applications

 It has integrated network support

 It support remote desktop feature

 It has a menu driven interface

 It is a graphical user interface GUI

 It provide help to the users

 It support object linking and embedding OLE and dynamic data exchange DDE

 It support faster operation and improve reliability

 It provides screen saver applications

 It support wizard features

 Clipboard is used to store copied data temporarily

 Word processor used to design documents

WHAT IS AN ICON?

PC SOFTWARE & “C” PROGRAMMING


PC SOFTWARE & “C” PROGRAMMING 21

Icons are small graphical images that can represent the computer's programs, files, folders and

printers etc. By double click on it with the left mouse button to start a program or open a file/folder. It

can be created, deleted or renamed as per the user requirement.

WHAT IS RECYCLE BIN?

Recycle bin is used to store the delete files. It is introduced in the Windows 95 operating system it

contains two properties restore and delete

 Restore: the purpose of restore option is to retrieve the files or folders to previous position

 Delete: the purpose of delete option is remove the file permanently

WHAT IS A DESKTOP?

Desktop is the main workspace in a graphical user interface like Windows operating Systems. Users

can open file, open programs, store files and shortcuts on desktop. The user can also customize the

look of the desktop with images or wallpaper and custom icons. The default icons are

My Computer

This is a standard icon. It is used to access your computer's disk drives as well as your printer

settings and the Windows control panel etc.

My Documents: By default Windows OS save all documents you create in my documents folder.

Internet Explorer This icon is a shortcut to Microsoft's Internet Explorer browser; it is used to view

web pages on the internet.

Network Neighborhood The Network Neighborhood Icon points to a folder that contains links to any

other computers that are in your workgroup (if you have one), or on your network (again, if you have

one)

Recycle Bin: It shows all the deleted file names in the system. You can restore or delete the files

permanently from computer.

WRITE ABOUT START MENU?

The start button used to open the start menu. It is used to access your programs, settings and more

 Shutdown - shutdown, restart and standby.

 Log off - Log off the current user.

 Run - Used to run executable files (programs).

 Help - Opens the built-in Windows help.

 Search - Search for files, folders, etc.

 Settings - Printers and other settings.

 Documents - Recently viewed documents.

PC SOFTWARE & “C” PROGRAMMING


PC SOFTWARE & “C” PROGRAMMING 22

 Programs - Gives access to all of your programs.

What is a The Taskbar?

Taskbar is bar displayed at bottom of the desktop screen. It is used to navigate between open

programs or documents in a system. It contains start button, quick launch bar, minimized applications

looks like tabs and system tray.

Start button: it is the entry point in windows operating system. It is a button on task bar contains

commands that can access programs, documents, and settings

The system tray used to display icon of memory resident programs like clock, antivirus programs,

volume etc.

Quick Launch Bar: contains the quick launch icon of applications installed in a system. You can

launch an application by apply one click on icon. The quick launch bar can be removed from the

taskbar if required, simply right click on a blank part of the quick launch bar and select close toolbar

from the menu.

What is screen saver?

It is one of the features of windows. When there is no work on computer then the screen saver

automatically starts running. It provides password setting. It can be set active depending on the time

factor specified.

WHAT IS CONTROL PANEL? The control panel is used to view and modify system settings. It is

used to control computer and software installed in the system. It can be run by Select

StartSettings Control Panel to display control panel window. It has following icons

Accessibility Options: - it is used to configure keyboard, sound, display, mouse and other options

for disabilities. Add New Hardware: - it is used to add or remove hardware.

Add/ Remove Programs:- it is used to install or uninstall software’s

Date/ Time: - it is used to set data/time and location

Display: - used to set resolution of a screen, appearance of dialog box etc.

Fonts: - it is used to install or uninstall fonts

Game Controllers: - it is used to install game controller like joystick

Keyboard: - it is used to control keyboard and appearance of cursor

Mouse: - it is used to set the mouse pointers and speed of double click

Printers: - it is used to install printers

WHAT ARE FILES AND FOLDERS?

PC SOFTWARE & “C” PROGRAMMING


PC SOFTWARE & “C” PROGRAMMING 23

File is used to store the collection of information

Folder is used to store files and subfolders. It is similar to DOS directory.

The operations performed on file or a folder are create, copy, rename, delete etc

We can create folder with the help of mouse as

Right click the mouse and select new-and select folder to create a new folder

We can create file with the help of mouse as

Right click the mouse and select new-and select file to create a new file

WHAT IS WINDOWS EXPLORER? WHAT ARE THE FEATURES OF WINDOWS EXPLORER?

Windows explorer is a file manager application for windows operating system. It provides graphical

user interface for accessing the file system. It is used to view files, folders, disk drives etc in the

system. We can get the explorer in 2 ways they are

1. Select startRun and type explorer and click OK button

2. Select any application and click on right mouse button and select explore

Features of windows explorer

1. It is a file manager application

2. It is used to see all the application, files, folders, drivers in the system

3. It is used to see all the hardware components installed in the system

4. It Is also called Windows Shell, explorer.exe or explorer

What is the difference between Dos and Windows?

Dos Windows

It is a single user single tasking operating It is a multi-user multitasking operating

system system

It support Character user interface It support Graphical user interface

It is a single task operating systems It is a multi-tasking operating system

It does not support multimedia It support multimedia

PC SOFTWARE & “C” PROGRAMMING


PC SOFTWARE & “C” PROGRAMMING 24

MS-OFFICE

WHAT ARE THE TOOLS AVAILABLE IN MS-OFFICE?

The MS-Office contains the following tolls

 MS-Word: it is a general purpose word processor. It is used to design letter, cards etc

 MS-Excel: it is an electronic spread sheet. It is used to maintain ledgers, create charts,

analyze data etc

PC SOFTWARE & “C” PROGRAMMING


PC SOFTWARE & “C” PROGRAMMING 25

 MS-PowerPoint: It is graphical software for slides. It is used to design presentations,

animations, multimedia applications etc.

 MS-Access: it is a relational database management system. It is used to design tables,

queries, reports, forms etc.

 MS-Outlook: it is information management software. It is used to send or receive mails

 MS-publisher: it is desk top publishing software for news, letters, post cards etc.

 MS-front page: it is a general purpose web page editor

 MS-PhotoDraw: it is a powerful graphics program for creating, editing images

EXPLAIN FEATURES OF MICROSOFT WORD?

Microsoft word is word processing software introduced by Microsoft Corporation USA. It has the

following features

1. Using MS-word you can create the document and edit them later by add, modify, move,

delete text

2. We can Change the size of the margins to format document

3. We can change Font size and type of fonts.

4. We can insert Page numbers and Header and Footer in a document

5. Spellings can be checked and corrected automatically

6. Word count and other statistics can be generated.

7. Text can be formatted in columnar style as we see in the newspaper.

8. Text boxes can be made.

9. We can also mix the graphical pictures with the text.

10. Word also has the facility of macros. Macros can be either attached to some function/special

keys or to a tool bar or to a menu.

11. It also provides online help of any option.

12. Table feature used to insert a table in a document

13. Clipboard features to copy data from one file to another

14. Auto correct feature is used to automatically correct the misspelled words at the time of data

entry

15. Auto fill features used to automatically insert lengthy sentences using abbreviated words

16. Auto number and bullet list used to automatically create a number, bullet list

17. Mail merge feature to send a common information to a group of people

18. It is used to Create a document for a web page

PC SOFTWARE & “C” PROGRAMMING


PC SOFTWARE & “C” PROGRAMMING 26

19. Header and footer feature used to add header, footer for each page in a document

20. It is possible to Insert images, clip arts in to a document

21. Equation editor used to insert mathematical equations in a document

22. We can Print the word document using printer

23. It is possible to create different version of a document. Each version contains a separate set

of modifications

24. We can secure the document by providing a password, hide the text etc.

25. Template feature is used to create a predefined style of a document

EXPLAIN ABOUT FILE MENU?

The file menu contains the following options

1. New Ctrl + n used to create a new document or template

2. Open Ctrl + o used to open an existing document

3. Save Ctrl + s used to save the document

4. Save as F12 used to save the existing document with another name

5. Save as web page to save the document as a web page in html format

6. File search used to search the require file under directory

7. Versions used to save the same file with different version. Each version is having a specific

set of modification. You can get the modifications of any version by selection the version

number

8. Web page preview used to preview the document as a single web page

9. Page setup to set the page margins, pager size, header and footers of a document

10. Print preview to view the document before print to verify the margins of a document

11. Print to print the document using printer

12. Properties used to set the properties of a document like author etc.

13. Recently opened documents contains a list of recently opened documents

14. Exit to exit from word application

WHAT IS PASTE SPECIAL?

Paste special is used to paste the selected cut or copy information from other applications to word

document. By default Paste Special acts as Paste option. You can also select the type of format to

paste the content in a word document.

HOW TO CREATE A NEW DOCUMENT?

PC SOFTWARE & “C” PROGRAMMING


PC SOFTWARE & “C” PROGRAMMING 27

Step 1 Select Start Program filesMS OfficeMS-Word to open MS-Word application

Step 2 Select New option under File menu to display New Document dialogue box

Step 3 Select blank document document option to open blank document windows

Step 4 Design the document as per your requirement

Step 5 Select save option under File menu to display save as dialog box

Step 6 Type the file name and click on save button

Step 7 The extension of a word document is “.DOC”

HOW TO CREATE A TEMPLATE?

Every MS-word document is created by using template. A template defines the basic structure and

format for a document. Example: Bio data, personal letters, professional letters etc.

Step 1 Select Start Program filesMS OfficeMS-Word to open MS-Word application

Step 2 Select New option under File menu to display New Document dialogue box

Step 3 Select blank document template option to open blank document template windows

Step 4 Design the document template as per your requirement

Step 5 Select save option under File menu to display save as dialog box

Step 6 Type the file name and click on save button to save the template

Step 7 The extension of a word document is “.DOT”

WRITE ABOUT PAGE SETUP OPTION?

Page setup is used to set the paper size, margins, and header and footer options of a document in

the following way

1. Select page setup option under file menu to display page setup dialogue box

2. The dialogue box window contains three tabs they are

a. Margins tab: used to set the margins of a page. it contain left, right, top, bottom

margins settings

b. Paper size: used to set the paper size. It contains paper width and height

c. Layout: it contains two options in header and footer section they are

i. Different first page

ii. Different header and footer on odd and even page

HOW TO PRINT A DOCUMENT?

Step 1 Select print option or (ctrl + p) under file menu to display print dialogue box

Step 2 Select the name of a printer under printer name list box

Step 3 If you don’t have a printer then select document printer and select print to file option and

enter file name to print the document

PC SOFTWARE & “C” PROGRAMMING


PC SOFTWARE & “C” PROGRAMMING 28

Step 4 Select All pages to print all the pages in a document

Step 5 Select current page to print current pages in a document

Step 6 Select page range to print the selected pages in that range

Step 7 Select number of copies per each page to print

Step 8 Click on OK button to print the document

WRITE ABOUT HEADER AND FOOTERS?

Every document is having three sections they are header section, document section, and footer

section. The header section is at the top of the page and footer section is at the end of a page. The

header section used to insert the document header. The footer section used to add page footer like

page number, date, auto text etc. and document section is used to enter the document

Create header and footer

Step 1 Select Start Program filesMS OfficeMS-Word to open MS-Word application

Step 2 Select New option under File menu to display New Document dialogue box

Step 3 Select blank document option to open blank document windows

Step 4 Design the document as per your requirement

Step 5 Select header footer option under view menu to activate header and footer section in a

document and display header and footer tool box

Step 6 Place the cursor in header section and Type & design the header as per your requirement

Step 7 Place the cursor in footer section and Type & design the footer as per your requirement

Step 8 Click close button in header and footer tool bar to close header and footer

Step 9 Now you can see header and footer for all the pages in a document.

Create Different headers and footers on odd and even pages

Step 1 Select page select option under file menu to display page setup dialog box window

Step 2 Select the layout tab and click on “different on odd and even pages”

Step 3 Click on OK button

Step 4 Select even page

Step 5 Select header and footer option under view menu

Step 6 Select header section and enter & design even page header

Step 7 Select footer section and enter & design even page footer

Step 8 Select odd page

Step 9 Select header section and enter & design odd page header

Step 10 Select footer section and enter & design odd page footer

PC SOFTWARE & “C” PROGRAMMING


PC SOFTWARE & “C” PROGRAMMING 29

Step 11 Click on close button to close header and footer tool bar to close header and footer

Step 12 Now you see different header and footer for even and odd pages

Create Different header and footer on first page:

Step 1 Select page select option under file menu to display page setup dialog box window

Step 2 Select the layout tab and click on “different first page” check box

Step 3 Click on OK button

Step 4 Choose viewheader and footer

Step 5 Type the text in header and footer as per your requirement

Step 6 Click on Close button in the header and footer tool bar

Step 7 Now you can see header and footer for all pages except the first page

WRITE ABOUT FONT OPTION IN MS-WORD?

Step 1 Choose font option under format menu to display font dialogue box

Step 2 Shortcut key is ctrl + d

Step 3 In the dialogue box window the font tab contains

a. Font name: it contains different font names apply to the text (Times, Arial)

b. Font style: it contains different font styles apply to the text. the font styles are regular,

bold, italic, bold italic

c. Font color: font color option used to apply different color to the text

d. Font size : it is used to increase or decrease the font size

e. Effects: It is used to apply superscript, subscript, strike through, double strike through

etc.

Step 4 The character spacing tab contains scale space and position

Step 5 The text effect tab contains different effects to be applied to the text

WRITE ABOUT SPELLING AND GRAMMAR?

Step 1 Choose toolsspelling and grammar option to display spelling and grammar dialogue box

window

Step 2 The short cut key is F7

Step 3 In the dialogue box windows show any spelling mistake in a document, suggestions to correct

the mistake in a document. It contains

i. Ignore: the purpose of ignore is leave the word as it is

ii. Change: the purpose of change button is replace the word from the list

iii. Add to dictionary: used to add the word to the dictionary

PC SOFTWARE & “C” PROGRAMMING


PC SOFTWARE & “C” PROGRAMMING 30

Step 4 It also contains auto correct feature

Step 5 It also provide grammar check box

WRITE ABOUT AUTO CORRECT FEATURE IN MS-WORD?

Autocorrect feature is used to automatically correct misspelled words, number format, style etc in MS-

Word at the time of crating a document

Choose toolsauto correct option then it display auto correct dialogue box window

Type the misspelling text in Replace box and type the correct spelling in with box

Click add button

Click on Ok button

For example if you type “there” in Replace box and type “three” in with box and click add. Then

whenever you type “there” it automatically correct to “three”

WRITE ABOUT BOOK MARK IN MS-WORD?

Book mark is a marker or address that identifies a document or a specific place in a document. It is

used to transfer the control to the specific location in a document.

Step 1 Choose insertbookmark option then it display bookmark dialogue box window

Step 2 Type the bookmark name and click on add button

Step 3 Select the bookmark name and click on go to button to go to bookmark location

WHAT IS A HYPERLINK? HOW TO CREATE HYPERLINK IN MS WORD?

The hyper link is a clickable peace of text or a graphical image that links a document to another

section of the same document or to another document or a web page.

Create a hyperlink

Step 1 Open an existing document or create a new document

Step 2 Place the insertion pointer on a document at required hyperlink position

Step 3 Select insert select hyperlink or Ctrl + K to open insert hyperlink dialog box

Step 4 Select a file, web page or create a new document option in the link to section and select the

document name or web page name to insert in to a document

Step 5 Select OK to insert a hyperlink on a document

Step 6 The hyperlink can be click by using Ctrl + click to open the linked document

WRITE ABOUT SAVE AND SAVE AS OPTIONS?

The save and save as options are exist in file menu. First time the save and save as option are

display save as dialog box windows. After making any changes file  save option save the changes

into the current file whereas filesave as option show save as dialog box window to save the

changes to the selected file

PC SOFTWARE & “C” PROGRAMMING


PC SOFTWARE & “C” PROGRAMMING 31

WHAT ARE THE DIFFERENT BREAKS AVAILABLE IN MS WORD?

There are four types of breaks in MS Word they are page breaks, column break, text wrapping break

and section break.

 Page break: used to break the page in to two pages even if the page is not completely filled

 Column break: used to break the page in to columns

 Text wrapping break: used to wrap the text in to another line.

 Section break: there are four types of section breaks. They are next page, continuous page,

even page, odd page

o Next page: used to create the section in next page

o Continuous page: used to create the section in the continuous page

o Even page: used to create the section in the even pages

o Odd page: used to create the section in odd pages

WRITE ABOUT TABLE HANDLING IN MS-WORD?

Tables are used to organize information in rows and columns. In MS-Word the table gives a flexible

way of aligning text in a grid of rows and columns. The smallest block in the table is knows as a cell.

Ms-word process two methods for creating the table they are standard method (Insert table option in

table menu 3.Using insert table icon) and drawing method

Using insert table icon

1. Place the cursor in a document where you would like to insert the table

2. Click insert table icon in toll bar

3. A pop up grid show rows and columns

4. Select required number of rows and columns and click left mouse button

5. The table insert in the document

Using insert table option in table menu

1. Place the cursor in a document where you would like to insert the table

2. Select "Table” menu and select Insert Table option

3. In the insert table dialog box select the number of rows and columns.

4. You can specify the style of a table by clicking the AutoFormat button and choosing a table

style.

5. Click the OK button to insert the table.

Using draw table method

1. Place the cursor in a document where you would like to insert the table

2. Select TableDraw Table option to display draw table toolbar

PC SOFTWARE & “C” PROGRAMMING


PC SOFTWARE & “C” PROGRAMMING 32

3. Select draw table option and the mouse pointer looks like a pen

4. Select line style form the list box

5. Select the weight of a line from Wight list box

6. Choose the color for outside boarder using outside boarder color button

7. Draw the require number of rows and columns of a table.

8. Select Erase table option to erase table columns or rows

After drawing table we can edit table by using the following options

1. Insert a row –select the row you want to insert, and then click Table, then select Row above

or row below to insert a row

2. Delete a row- select the row you want to delete, and then click Table, then Delete Rows

3. Merge cells- select the cells you wish to merge into one cell, and then select Table  Merge

cells

4. Split cells- select the cell or cells you want to split into multiple cells, then click Table  Split

Cells and then choose the number of rows and columns to create, and then select OK.

5. Formula – used to insert a formula in selected cell like max, min, sum

6. Show / hide gridlines – to show / hide the grid lines of a table

For example let us consider a table contains 6 rows and 6 columns contain student data as
follows
Sno Name M1 M2 M3 Total

1 Aaa 70 60 50 180

2 Bbb 50 60 40 150

3 Ccc 40 50 40 130

Max 180

Min 130

To find the maximum apply function max (above) and for minimum min (above)

EXPLAIN MAIL MERGE CONCEPT?

Mail merge is used to send a letter to a group of people at a time. In Ms-Word this feature available

under tools menu. This can be done by merge the common letter to a group of people address to

generate individual letters. It has three parts they are

Main document: It is a document letter you want to send it to all peoples. This can be a form letter,

label, envelop etc

PC SOFTWARE & “C” PROGRAMMING


PC SOFTWARE & “C” PROGRAMMING 33

Data source: It is a file that contains the data i.e. merged into the document

Steps to create a mail merge are as follows

1. Create a main document as form letter or open an existing document

2. Select Tools  Mail Merge to open mail merge dialog box

3. Click "Create" button and select Form Letters and select active window

4. Design the document with common information send to all the peoples

5. Under Mail Merge dialog box Click "Get Data" button and select create database option

6. The Data base dialog box show list of predefined fields. You can use the predefined fields or

add new fields or remove predefined fields.

7. Click on OK and save the data base.

8. Word display a message box click edit data source button

9. enter the data for the data base fields click OK

10. now we can see a mail merge tool box on a standard toolbar

11. Place the insertion pointer on a form letter document and insert the merge fields one by one

a. Ex.

b. <<Name>>

c. <<Street>>

d. <<City, State, Zip>>

12. Save the main document

13. Under Mail Merge dialog box click the "Merge" button

14. Word display a dialog box window to select all or in between the range and click on merge

button

15. The merge document is created as a separate copy.

Example

Principal

Srinu

Line 3

Kakinada

Andhra Pradesh 533001

This is inform that tomorrow is a holiday

Principal

WRITE ABOUT MACROS IN MS- WORD?

PC SOFTWARE & “C” PROGRAMMING


PC SOFTWARE & “C” PROGRAMMING 34

A macro is a series of word commands grouped together as a single command. We can assign a

macro to a tool bar, menu or a short cut key combination

1. Choose toolsmacro and click on record macro button

2. Enter the name for the macro in the record macro text box

3. Enter description of a macro in the description text box

4. To assign the macro to shortcut keys, click Keyboardname of the macro you are recording.

5. Type the key sequence and then click Assign.

6. Enter the data that you want to record

7. Click on stop button on the macro record tool bar

Running a macro

If the macro is assigned to a keyboard shortcut key then

Selecting the keyboard short cut keys

If the macro not assigned to a keyboard command or a toolbar then

1. Choose Tools Macro,

2. Under Macro Name, click the macro you want to run

3. Click the Run button

Edit the macro

1. Choose toolsmacromacros and select macro name

2. Click on edit button

Delete a macro

1. Choose toolsmacromacros and select macro name

2. Click on delete button

WRITE ABOUT CUT, COPY AND PASTE?

These options are available in the edit menu

Edit cut (ctrl + X)

Edit copy (ctrl+c)

Editpaste (ctrl+v)

When you are perform copy/cut operation the selected data copied/moved into clipboard. When you

perform paste operation the will be display from the clipboard to the required position

DIFFERENCE BETWEEN UNDO AND REDO?

These two options are exit in the edit menu edit  undo (ctrl+z) and editredo (ctrl+y). Undo erases

the last change done to the document where as redo reverse the undo

WHAT IS HYPER TEXT?

PC SOFTWARE & “C” PROGRAMMING


PC SOFTWARE & “C” PROGRAMMING 35

Hypertext is text displayed on a computer or other electronic device with references (hyperlinks) to

other text that the reader can immediately access, usually by a mouse click or key press sequence.

Apart from running text, hypertext may contain tables, images and other presentational devices.

Hypertext is the underlying concept defining the structure of the World Wide Web, making it an easy-

to-use and flexible format to share information over the Internet

WHAT ARE THE GRAPHICAL OBJECTS IN WORD?

Graphical objects are used to add images, lines, shapes by using drawing toolbar. It is available

under the viewtoolbardrawing menu. It contains

AutoShapes: It contains predefined shapes like lines, block lines, connectors, flow chart symbols,

stars and banners, collector symbols. It is used to design the required diagram and banners in the

effective way

 Line: used to draw a basic line

 Arrow: used to draw basic directed arrow

 Rectangle: used to draw a rectangle and add a text to it

 Oval: used to draw oval, circles and add a text to it

 Text box: used to add a text to a design

 WordArt: Used to design a user defined text to a predefined font, color, design

 Insert diagram or Organization chart: used to insert an existing diagram or an organization

chart

 Insert a clipart: clipart means a predefined picture. It is used to insert clipart to the document

 Insert picture: used to insert an existing picture

 Fill color: used to fill the selected object with the selected color

 Line color: used to draw color lines

 Font color: used to apply various colors to the selected font

 Line style: used to apply various line styles to the selected lines

 Dash style: used to apply various dashed line styles to the selected lines

 Arrow styles: used to apply various arrow styles to the selected arrow

 Shadow style: used to apply a shadow to selected object

 3D style: used to apply a 3D shadow to selected object

PC SOFTWARE & “C” PROGRAMMING


PC SOFTWARE & “C” PROGRAMMING 36

WHAT IS A WORK SHEET?

Worksheet is a sheet or a page contains grid or rows and columns. Each block is called as a cell. It

contains 256 columns (A to IV) and 65536 rows. Each row can be uniquely identified by a cell

address. It contains row id and column id for example A1, X3 etc. Excel workbook by default contains

3 worksheets. The workbooks in Excel are stored with the extension ‘xls’.

What is range how they are defined?

A range is rectangular group of cells. The smallest range is defined with single cell. The largest range

is defined with group of cells. The ranges are defined bby address separated by a colon ( : } example

=sum(A1:A10)

WHAT IS AN OPERATOR? EXPLAIN THE DIFFERENT TYPES OF OPERATORS IN MS-EXCEL?

Operator is a symbol used to perform a specific operation like addition, subtraction, and multiplication

etc of a formula. There are basically 3 types of operators. They are

Arithmetic Operators: Used to perform arithmetic operation. They are

Operator Meaning

+ Addition

- Subtraction

/ Division

* Multiplication

% Percent

^ Exponentiation

Hear unary operators use one operand and binary operator use two operand

For example the formula = 5+2 requires 2 or more values the formula = 3% requires only one value

Comparison Operators: used to perform comparison operations. They are

Operator Meaning

= Equal

> Greater than

< Less than

>= Greater than or equal to

<= Less than or equal to

<> Not equal to

Example The formula=A1<25 produces the logical value TRUE if cell A1 contains a value less than

25, otherwise the formula produces the logical value FALSE.

PC SOFTWARE & “C” PROGRAMMING


PC SOFTWARE & “C” PROGRAMMING 37

Text Operator (&): used to Joins two or more text values to produce a single combined text value For

example If cell A1 contains the text “SOUTH ZONE”, then the formula = “Total scales for “&A1

produces the text value “Total sales for SOUTH ZONE”.

WHAT IS A CUSTOM LIST? HOW IS IT CREATED?

Custom list is the list used to fill the worksheet with auto fill handle created by the user. It can be

create by the following way

For example if you want to insert North, South, East and West are needed to be entered frequently

into the worksheet create a custom list as

Defining Custom lists:

1) Enter the list “North South East West” into a range of cells, in a row or column.

2) Select the range containing the list.

3) Choose toolsoptionsselect the custom lists tab.

4) Check the import button, the list will be displayed in the custom list box.

5) Click OK. After the custom list is defined, to perform an auto fill, enter the values in the custom list

and drag the fill handle.

WHAT ARE THE VARIOUS ADDRESSING METHODS ARE IN MS EXCEL?

There are three types of addressing methods

1) Relative addressing: -in this addressing method the address changes relative to the location

where the formula is either copied or moved.

e.g. The formula = Sum (A1:A5), when copied to column B becomes = Sum (B1:B5).

2) Absolute Addressing: - An absolute address always points to exactly one address. In absolute

address ’$’ sign is used to indicate the absolute position of the cell addresses. For example $E$5

means the row and column address is fixed.

3) Mixed Addressing:- Mixed Addressing is a combination of relative and absolute address. The

possible combinations for a cell are C3.

$C3 - Column ‘C’ is fixed, Row 3 Varies

C$3 - Column ‘C’ varies, Row 3 is fixed

HOW TO COPY RANGE OF CELLS

1) Select the required cells that you want to copy

2) Select copy command from edit menu

3) Select the destination cell

4) Select the paste command from edit menu

PC SOFTWARE & “C” PROGRAMMING


PC SOFTWARE & “C” PROGRAMMING 38

HOW TO MOVE RANGE OF CELLS?

1) Select the required cells that you want to move

2) Select copy command from edit menu

3) Select the destination cell

4) Select the paste command from the edit menu

WHAT ARE THE VARIOUS TYPES OF FUNCTIONS IN MS EXCEL?

Functions are special pre-written formulas that take a value or values and perform an operation and

return a value to the cell. It is used to simplify the work. For example Instead of the formula =

a1+a2+a3+a4+a5, we can use the function = sum (a1: a5).

The syntax for entering functions is = FUNCTION (values...)

1) All functions begin with a “=”sign.

2) Parentheses are used to enclose all arguments and commas are used to separate

individual arguments. Example = Sum (2,13,50,67).

3) No spaces are allowed within a function except within a string.

Function categories: Excel function can be categorized as follows.

1) Mathematical

2) Statistical

3) Financial

4) Date & Time

5) Logical

6) Text

Mathematical functions: These functions are used to calculate general, matrix and trigonometric

values some of the mathematical functions are

Sum (): it displays the sum of the given number or given range

Syntax: =sum (a1, a2, a3) or =sum (a1:a3)

Example: = sum (10, 20,30) gives 60

Product (): it displays the product of the given number or given range

Syntax: =product (A1,A2,A3)

Example: =product (10,20,30) gives 6000

Absolute (); it display the value ignore the sign of that number

Syntax: =abs (value)

Example: =abs(-2) give 2

PC SOFTWARE & “C” PROGRAMMING


PC SOFTWARE & “C” PROGRAMMING 39

Fact (): it displays the factorial of the given number

Syntax:=fact(number)

Example: =fact(4) gives24

Sqrt(): it dislay the square root of the given number

Syntax: =sqrt(number)

Example: =sqrt(16) gives 4

Even(): it rounds the given number nearest to the even number

Syntax: =even(number)

Example: =even(3) gives 4 and =even(4) gives 4

Odd(): it rounds the given number nearest to the odd number

Syntax: =odd(number)

Example: =odd(2) gives 3 and =odd(3) gives 3

Trunk(): it truncates the given number to required number of digits

Syntax: =trunk(number, digitis)

Example: = trunk(68.789,2) given 68.78

Round(): it rounds the given number to a specific number of digits

Syntax: =round(number, digits)

Example: =round(68.789,2) gives 68.79

Log(): it display the logarithm value

Syntax: =log(number, base)

Example: =log(10,2) gives 3.321928

Statistical Functions: These functions are used to perform statistical operations. They are

Max(): it display the maximum of the given numbers or given range

Syntax: =max(a1,a2,a3)

Example: =max(10,20,30) gives 30

Min(): it display the minimum of the given numbers or given range

Syntax: =min(a1,a2,a3)

Example: =min(10,20,30) gives 10

Count (): it display the number of arguments present in the list

Syntax: =count (a1,a2,a3) or =count (a1:a4)

Example: =max(10,20,30) gives 3

avg(): it display the average of the given numbers or given range

PC SOFTWARE & “C” PROGRAMMING


PC SOFTWARE & “C” PROGRAMMING 40

Syntax: =avg(a1,a2,a3)

Example: =avg(10,20,30) gives 20

median(): it display the median of the given numbers or given range

Syntax: =median(a1,a2,a3) or =median(a1:a4)

Example: =median(10,20,30) gives 20

Financial Functions:

Financial functions are used to calculate amounts used in financing, budgeting, etc.

Fv(): it is used to display the future value given a series of equal payments

Syntax: = FV (rate, turn, payments)

Pmt() it is used to display the payment required for a loan amount given the interest rate and loan

term

Syntax: = PMT (rate, term, principal)

Pv(); the present value given a series of equal payments, the interest rate and the term.

Syntax: = PV (rate, term, principal)

Date and Time functions:

Date and time functions use date serial number to calculate various date and time related numbers.

Date(): it is used to specify the date

Syntax: =date(year/month/date)

Example: =date (2010/11/25)

Now(): it display the system date and time

Syntax: =now()

today(): it display the system date

Syntax: =today()

hour(): a value from 0 to 23 corresponding to given value

Syntax: =hour(number)

Month(): a value from 1 to 12 corresponding to the given number

Syntax: month(number)

Logical Functions: Logical functions are used to display the status of the given condition

if(): it display the the value depending on the condition

Syntax: =if (condition, true, false)

Example: =if(a>b,”a is big”,”b is big”)

PC SOFTWARE & “C” PROGRAMMING


PC SOFTWARE & “C” PROGRAMMING 41

And(): it returns true value if all the conditions will be true

Syntax: =and(cond1, cond2, cond3)

or(): it returns true value if any one of the conditions will be true

Syntax: =or(cond1, cond2, cond3)

not(): it returns opposite status of the given condition

Syntax: =not(cond1)

Example:=not(2>3) return true and =not(3>2) returns false

True(): it display the logical value true

Syntax: =true

False(): it display logical value false

Syntax: =false

Text Functions: Text functions are used to convert and manipulate text strings.

Lower(): it converts the text into lower vase format

Syntax: =lower(text)

Example:=lower(“BSC”) returns bsc

upper(): it converts the text into upper case format

Syntax: =upper(text)

Example:=upper(“bsc”) returns BSC

Concatenate(): it combines one or more strings

Syntax: = concatenate (text1, text2, text3 )

Exmaple: = concatenate ( “bsc”,”mecs”) return bsc mecs

Left(): it display the left most n characters from the text

Syntax: =left(text, number)

Example: =left(“language”,3) returns lan

right(): it display the right most n characters from the text

Syntax: =right(text, number)

Example: =right(“language”,3) returns age

WHAT IS A GOAL SEEK?

Goal seek:It is an analysis tool used to find the required result of a formula by changing the formula

effected cell. It is used to find a specific result for a cell by adjusting the value of one of the formula

effected cell. Excel varies the value in a cell until the formula that is dependent on that cell returns the

result the user wants. Goal seeking saves time performing trial and error analysis.

PC SOFTWARE & “C” PROGRAMMING


PC SOFTWARE & “C” PROGRAMMING 42

On the Tools Goal Seek.

In the Set cell box select the result of a formula cell

In the To value box, type the result you want.

In the By changing select the formula effected cell

WHAT IS A SCENARIO?

Scenario: This keeps a track of different sets of values for the user. Scenarios allow the user to

store different values for variables in the workbook each combination or set of values is a “Scenario”,

Different scenarios can be used and named. After the scenarios are entered, a report can be printed

that compared the different scenarios and lists all the sets of input values, with this report, the user

can easily compare the various scenarios and analyses them.

Open a worksheet and Sheet1 as Budget

On the Budget sheet, enter the Finance budget, as shown at right

Name the following cells (there are Naming instructions here: Name a Range). Naming the cells is not

required, but will make it easier to manage the scenarios, and read the reports:

Name cell B1 as Dept

Name cell B3 as Sales

Name cell B4 as Expenses

Name cell B6 as Profit

In cell B6, enter the following formula: =Sales - Expenses

Create the Scenario

From the Tools menu, choose Scenarios.

In the Scenario Manager, click the Add button

Type name for the Scenario; For this example, use Finance.

Press the Tab key, to move to the Changing cells box

On the worksheet, select cells B1

Hold the Ctrl key, and select cells B3:B4 Note: There is a limit of 32 changing cells

Press the Tab key, to move to the Comment box

(Optional) Enter a comment that describes the scenario.

Click the OK button

The Scenario Values dialog box opens, with a box for each changing cell.

PC SOFTWARE & “C” PROGRAMMING


PC SOFTWARE & “C” PROGRAMMING 43

You could modify these values, but in this example they contain the values currently on the

worksheet, and don't need to be changed.

Click the OK button, to return to the Scenario Manager.

Click the Close button, to return to the worksheet

Show a Scenario

Once you have created Scenarios, you can show them. In this example, the Marketing scenario is

currently visible. To change to a different scenario:

From the Tools menu, choose Scenarios

In the list of Scenarios, select Finance

Click the Show button

Click the Close button.

WHAT IS A DATABASE? HOW TO CREATE A DATABASE IN EXCEL? OR

EXPLAIN THE PROCEDURE TO USE WORKSHEETS AS DATABASE IN MS EXCEL?

A database is a collection of related data, which is organized, in a tabular form. Excel stores

information in a list or database. Each row of information in a list is called a record. Each column is

called a field. All field names in the database must be unique.

Data forms used to input data into a spreadsheet more easily. The form appears on top of your Excel

spreadsheet and allows you to enter up to 32 fields per record. The column headers become the form

field labels.

The main advantages of a data form are

1. We can view one record at a time

2. Orientation of data in vertical and shortcut keys are allowed

3. We can insert new record

4. We can delete a record

5. Find the record based on criteria

6. We can navigate through the records using the controls

Process:

1. Open your spreadsheet.

2. Adjust the width in Column A to a suitable width for all columns. The form will use this width

as the default size for all form fields.

3. Add your column labels

4. Select data range including column labels.

PC SOFTWARE & “C” PROGRAMMING


PC SOFTWARE & “C” PROGRAMMING 44

5. From the Data menuselect Form

6. Click OK to use the first row as your column labels.

Sort the data: sorting means arrange the data in ascending or descending order.

Select datasort to display sort dialog box window it contains the following options

Sort by: field names according to the data is to be arranged

Sort order: it is used to display the data either in ascending or descending order

Then by: the list has to be sorted by more then one column

Display the subtotal: excel provides a facility to generate sub totals by divide the data into groups

depending on the field name.

Select datasubtotal to prepare the subtotals. To get the subtotal we have to follow

1. The first row in the list should contains field name

2. The data should be sorted

Filtering data: the process of finding or selecting information is called filtering. In this filtering option

does not rearrange the data. Excel provides an auto filter to handle the simple criteria and advanced

filter to handle the complex criteria

For example

HOW TO SORT DATA ON A WORKSHEET?

Sorting a list rearranges the records in to a specific order. Excel is used to organize data in a list

numerically, alphabetically or chronologically. Data is a list can be sorted either in the ascending /

descending order.

To perform sort:

Step 1: Select the list to be sorted.

Step 2: Invoke the sort command and specify details of sort.

PC SOFTWARE & “C” PROGRAMMING


PC SOFTWARE & “C” PROGRAMMING 45

Sort by- Column name according to which the data is to be arranged.

Sort order- either ascending (or) descending

Then by - If the list has to be sorted by more than one column, then its column name along with sort

order

My list has - Specify whether this list contains header row or not.

HOW TO FILTER DATA ON A WORKSHEET?

In Excel, the process of finding or selecting information is called filtering. Filtering is a facility to find

subset of records from a large list of records. Whenever a list is filtered, Excel displays only those

records that contain a certain value or that meet a certain criteria specified by the user. Filtering does

not rearrange the list, but temporarily hides rows that need not be displayed. Excel provides an auto

filter to handle simple criteria and advanced filter to handle complex criteria.

HOW TO CREATE SUBTOTALS IN A WORKSHEET?

Excel provides a facility of automatically generating subtotals for data. The data to be subtotaled is

divided into groups according to a certain criteria. In order to identify the grouping, the group must

have two or more entries, with the same value in adjacent columns. Selecting data and select

subtotals can generate automatic subtotals

To prepare the data for automatic subtotals

1) Two or more records must be equal in at least one-way.

2) Column data must be grouped to sort the data

3) The first row in the data list should contain field headings.

WHAT IS A PIVOT TABLE? HOW TO CREATE IT?

It is an interactive table used to combine and compare large amount of data

1) Design the worksheet with a collection of grouped data

2) Select the cells of a worksheet

3) Select datapivot table to show pivot table dialog box

4) Select the column name and drop it on drop row field

5) Drop column field in drop column field area

6) Drop the data item field in data item are

7) Click on OK

WRITE ABOUT EXCEL TABLE AUTO FORMAT?

Auto format is used to format the table by using pre-defined styles. To apply the auto format in the

following way

PC SOFTWARE & “C” PROGRAMMING


PC SOFTWARE & “C” PROGRAMMING 46

1) Design the work sheet

2) Select the range of cells that contains table data

3) Select formatauto format to display auto format dialog box

4) Select the require format and click Ok

DEFINE CHART? WHAT THE DIFFERENT TYPES OF CHARTS ARE IN EXCEL?

A chart is a graphic representation of worksheet data. Showing data in a chart can make the data

clearer and easier to read. Charts help to analyze data and make comparison between different

worksheet values. Charts can be separately stored on chart sheets, which can be printed, viewed or

edited, or they can be embedded in the current sheet so that they become a part of it.

Type of charts

Area Charts:

An area chart shows the magnitude of

change over time. An area chart is a stacked

line chart, with the area between the lines

filled with color or shading

Bar Charts: PRODUCT SALES Laptop


A bar chart consists of a series of horizontal Floor
1993 Desktop
bars that allow comparison of the relative size

of two or more items at one point of times 1992

1991
0 500 1000
Column Charts:
REGIONAL SALES
A column chart consists of a series of vertical

columns that allow comparison of the relative


6000
size of two or more items.
4000

2000

1991 1992 1993

PC SOFTWARE & “C” PROGRAMMING


PC SOFTWARE & “C” PROGRAMMING 47

Line charts:

A line chart is used to show trends over time.

In a line chart, each of the data series is used 500


400
to produce a line on the chart.
300

200
100

Jan Feb Mar Apr

Pie charts:
Product Sales
A pre chart is best used for comparing the

percentages of a sum that several numbers Laptop Desktop


39 % 32 %
represent. The full sum is the pre and each

number is a slice.

Floor
29 %

X Y chart

Scatter data points connected by a smooth

line

HOW TO CREATE A CHART OR A GRAPH IN EXCEL

Create a new excel work book or open an existing work book

Select insert menu and select char to open chart wizard to open chart wizard

Step 1 of 4

Select type of the chart from the available list of standard type charts

Or select a custom chart from custom types

Click Press and hold to view sample button to view the preview of select chart and click next to go to

next step

PC SOFTWARE & “C” PROGRAMMING


PC SOFTWARE & “C” PROGRAMMING 48

Step 2 of 4

Under data range tab Select the data range of the chart

Select the series in option as a rows or a columns

Under series tab select the series row or a columns

Select category x axis label name

Click next to go to next step

Step 3 of 4

Under titles tab select chart title, select category x axis, value y axis

Under axes tab select the primary axis – category x axis as automatic, category or time-scale and

select value y axis to display y axis range value or not

Under gridline tab select gird lines of category x axis and value y axis as major grid lines or minor gird

lines

Under legend tab select or deselect the show legend option to show or hide the legend on chart.

Select placement position of a legend in a chart

Under data labels select label contest series type as series name , category name or a value etc

Under data table tab select show data table check box to show the data table along with the chart

Click next to go to the next step

Step 4 of 4

Select place chart option as a new sheet or as object in

Click finish to view the chart on work sheet

HOW TO VALIDATE DATA IN MS EXCEL

Select data and select validation to open data validation dialog box

Under settings tab select validation criteria as select the type of value under allow box and select data

type in data box and select maximum and minimum allowed value for that data type Under input

message box type the message to appear once you visit the cell

Under error alert tab select the type of error as stop, waning or information and enter the error

message and click OK

WHAT ARE THE BASIC COMPONENTS OF POWER POINT?

Power point is presentation software. It is used graphical software for slide, animations and

presentations. It provides a library of pre drawn images like symbols, graphs etc. it has the following

components

PC SOFTWARE & “C” PROGRAMMING


PC SOFTWARE & “C” PROGRAMMING 49

Presentations: A Power point presentation is a collection of slides, handouts, speaker’s notes all are

present in one file.

Slides: Slides are the individual “pages” of the presentation. Slides can have titles, text, graphs,

drawn objects, shapes, clipart, drawn art and visuals created with other applications and more.

Handouts: Handouts consist of smaller, printed versions of our slides either two, three or six slides

per page.

Speaker’s notes: We can create and print speaker’s notes. We can see a small image of the slide

on each notes pages

Outlines: While working on a presentation the option of working with out presentation in outline; the

titles and main text appear, but not the art or text types with the text tool.

The slide master is used to design the style of a sheet which is used to create new slides. It

supports custom animation schemes, slide transitions, background effects and interactive PowerPoint

with a system of links and buttons etc

WHAT ARE THE FEATURES OF POWER POINT?

1. Power point is a presentation software

2. It is used to create Slides, Handouts, Speaker’s notes and Outlines

3. Auto content wizard is used to design presentation easily

4. Design Templates are used to create a slides in pre designed format

5. The slide master is used to design the style of all the slides in a presentation

6. It supports custom animation, slide transitions, background effects

7. Action button used to move to the next slide

8. Slide transition used to add affects for the slide

9. Custom animation is used to animate objects of a slide

10. We can add music files from HD or CD.

11. We can record narration of a slides

12. Color Schemes used to change the color combinations of various slides.

13. You can insert a text box anywhere on a slide.

14. Format menu is used to change font, style, color of text

15. Auto-fit Text used to automatically fit the text in slide

16. Auto formatting features used to automatically format the slides

PC SOFTWARE & “C” PROGRAMMING


PC SOFTWARE & “C” PROGRAMMING 50

17. Table editor used to edit tables on a slide

18. We can insert Animated objects on a slide

19. Clipboard used to save multiple copied items

20. We can save the presentation as a web page

WHAT IS ANIMATION? HOW TO USE CUSTOM ANIMATION IN POWER POINT?

PowerPoint animation is a form of animation which is used to create a presentation. There exist two

types of animations they are preset animations and custom animation.

Animations are two types they are slide transitions and custom animations

Custom Animation is a set of effects which can be applied to objects in PowerPoint

 Under Check to animate slide objects, put a checkmark in the box next to the objects you

want to animate.

 Under Order & Timing tab Use the up and down arrows to the right of Animation Order to

change the order of slides

 Under Start Animation set the timing Select each object and then do one of the following:

o To start the animation by clicking the object, select the On mouse click option.

To start the animation automatically, select the automatically option, and then enter
o
the number of seconds you want to have elapse since the previous animation.

 select effects tab and select the required animation effect under entry animation and sound

section

 select the sound effect from the predefined list of sounds

 Select after animation section to specify after animation effect

 Under introduce text section select the type of text entry as word by word or character by

character or entire line

 Select in reverse check box to reverse the order of text entry

Chart effects

 Introduce chart elements section is used to set the animation by category

 Select animate grid and legend check box to animate grid and legend of a chart

 Entry animation and sound section select type of animation and select the sound

 After animation section select the type of animation

Transitions

 In Slide or Slide Sorter view, select the slide or slides on which you want to add a transition.

 On the Slide Show menu, click Slide Transition.

PC SOFTWARE & “C” PROGRAMMING


PC SOFTWARE & “C” PROGRAMMING 51

 From the Effect drop-down list, click the transition you want.

 Select any other options you want (speed Slow/Medium/Fast, Advance on mouse Click or

Automatically, Sound or No Sound)

 To apply the transition to the selected slide, click Apply. To apply the transition to all the

slides, click Apply to All.

 Repeat the process for each slide you want to add a transition to.

 To view the transitions, on the Slide Show menu, click Animation Preview.

WHAT IS A DATABASE MANAGEMENT SYSTEM?

A DBMS is a set of software programs that controls the organization, storage, management, and

retrieval of data in a database. A database is a structured collection of records or data that is stored in

a computer system in the form of a table. Each column of a table is called a field and row is called a

record.

WHAT IS A RELATIONAL DATABASE MANAGEMENT SYSTEM?

Relational database management system (RDBMS) is a database management system (DBMS) in

which data is stored in the form of tables and the relationship among the data is also stored in the

form of tables.

WHAT IS A DATABASE? WHAT ARE THE OBJECTS AVAILABLE IN MS ACCESS?

A database is a structured collection of records or data that is stored in a computer system in the form

of a table. Each column of a table is called a field and row is called a record. Relational database

management system (RDBMS) is a database management system (DBMS) in which data is stored in

the form of tables and the relationship among the data is also stored in the form of tables. Ms Access

is a RDBMS. The objects of MS Access are tables, query, form, macro, report. It can be stored in a

single file with extension “.mdb”

Objects:

Table: Tables are used to organize information in rows and columns. The database must have at

least one table. Tables contain grids of rows and columns. Each row in a table is called a record and

each column in a table is called a field. Each field contains a specific type of information such as first

name, last name, phone number, e-mail id, date of joining etc

Query: A Query is a filtering process of extracting information from a database. You can define

filter/condition criteria to extract records that satisfy the filter/condition. There are three types of

queries

Select query used to displays a subset of the entire data depending upon a condition

PC SOFTWARE & “C” PROGRAMMING


PC SOFTWARE & “C” PROGRAMMING 52

Action Queries – used to create, delete or update tables

Cross table queries: used to display spreadsheet like cross tabular result forms.

Forms: Forms are used to display information in a specific manner. It is used to add, modify and

delete data in a database. In Access we can create 6 types of forms

Columnar- Fields arranged as columns.

Tabular - Displays data in row and column format similar to a datasheet.

Data sheet - Identical to table datasheet

Main/ Sub form- Displays both main and related table data.

Chart - Displays information with a graph.

Pivot Table Form - Creates a Pivot Table Form similar to Excel Pivot Table Report.

Reports: A Report summarizes data to view it on screen or print or publish it on the web. Reports are

used to present data in a meaningful and attractive manner. It contains data, charts and images, even

audio and video.

Data Access Page: A Data Access Page is a web HTML page created in Access that allows users to

view, add or edit data stored in an Access database. Using Data Access Pages you can easily create

interactive forms for users on a web site.

Macros: it is used to automate repetitive tasks

Modules: It is used to design the forms, report etc as per the user requirement by using Visual Basic

for Application (VBA) module

HOW TO CREATE A DATA BASE IN MS ACCESS?

Creating a new database:

A well designed database ensures convenient and fast access to the information that you want. If

your database design is not optimized you may not be able to get the results that you want from your

data and you may frequently need to redesign your database. While creating a new database, keep

the following points in mind.

Define the purpose of your database. Consider the present and future questions (queries) you may

want to answer from the stored data. Eg. If you want to run a query on a customer’s database to

generate state wise city wise lists, create two separate fields for city and state instead of one address

field.

Determine the tables that you do or may need in future in the database. Each table contains

information only about one subject like customers, suppliers or items.

PC SOFTWARE & “C” PROGRAMMING


PC SOFTWARE & “C” PROGRAMMING 53

Determine the fields that you need in each table each field contains a specific kind of information

such as first name, last name or accounts balance.

Identify unique field values that allow Access to relate and store information contained in different

tables. These unique fields are also called the Primary key for the table. For eg. Two tables

containing employee’s background information and his current month’s salary details may be linked

using a primary field called employee code.

Here Employee table is called parent table and salary table is called child table. The employee code

in employee table will be called primary key and that in salary table is called “Foreign Key”. Foreign

key can be defined as the column in child table whose value should be one of the values of the

primary key column of parent table.

Determine the relationships between tables. A relationship works by matching the data in two

different tables using a common field. There are broadly two kinds of relationships – One-to-One and

One-to-Many. In a One-to-One relationship for one record in table A there is only one corresponding

record in table B, where as in One-to-Many relationship, for each record in table A there can be many

records in table B.

Steps to Create database:

1. Choose File New

2. Enter the name of the database file (which will be saved with extension .mdb) and click

on Create button.

3. Check on Tables tab, if it is not activated, double click on “Create table in Design View”

icon.

4. Then type the field name, select the data type, optionally enter description.

5. After specifying the details of all fields, close the window

6. When it prompts whether to save the changes, click on ’Yes’ button. In Save As dialog

box enter the table name and click on OK.

7. Double click on table object icon or select it and click on open button and then enter the

details of all the records.

WHAT ARE THE DATA TYPES SUPPORTED BY MS ACCESS?

Data types in Microsoft Access

Text Use for text or combinations of text and numbers, such as addresses, or for numbers that do

not require calculations, such as phone numbers, part numbers, or postal codes. Stores up to 255

characters The Field Size property controls the maximum number of characters that can be entered.

PC SOFTWARE & “C” PROGRAMMING


PC SOFTWARE & “C” PROGRAMMING 54

Memo: Use for lengthy text and numbers, such as notes or descriptions. Stores up to 65,536

characters

Number: Use for data to be included in mathematical calculations, except calculations involving

money (use Currency type). Stores 1, 2, 4, or 8 bytes; stores 16 bytes for Replication ID (GUID). The

Field Size property defines the specific Number type.

Date/Time: Use for dates and times. Stores 8 bytes

Currency: Use for currency values and to prevent rounding off during calculations. Stores 8 bytes

AutoNumber: Use for unique sequential (incrementing by 1) or random numbers that are

automatically inserted when a record is added. Stores 4 bytes; stores 16 bytes for Replication ID

(GUID). Yes/No

Use for data that can be only one of two possible values, such as Yes/No, True/False, On/Off. Null

values are not allowed. Stores 1 bit

OLE Object: Use for OLE objects (such as Microsoft Word documents, Microsoft Excel

spreadsheets, pictures, sounds, or other binary data) that were created in other programs using the

OLE protocol. Stores up to 1 gigabyte (limited by disk space)

HYPERLINK: Use for hyperlinks. A hyperlink can be a UNC path or a URL. Stores up to 64,000

characters

WHAT IS A PRIMARY KEY?

Primary Key: is a key field in which the values are unique and not null. One or more fields (columns)

whose value or values uniquely identify each record in a table a primary key cannot have Null values

and is used to relate a table to foreign keys in other tables.

HOW TO SET RELATION BETWEEN TWO TABLES IN ACCESS?

Linking two tables/Defining a relationship between tables

To link two tables, the master tables should have a primary key. For example consider the following

tables.

EMPLOYEE (EmpNo, Name, DOJ, Dept, Address)

SALARY (EmpNo, Basic, DA, HRA, PF, IT)

Here EMPLOYEE is the master table and EMPNO is the primary key. In salary table EMPNO can be

defined as primary key if required. Now follow the below procedure to link these two tables.

1. Choose Tools Relationships to displays Relationships window with the two tables.

2. Click on the Empno field in the EMPLOYEE table and drag and drop on EmpNo field in

SALARY, It displays a line joining the two tables.

PC SOFTWARE & “C” PROGRAMMING


PC SOFTWARE & “C” PROGRAMMING 55

3. Click on the close button to close the window.

WHAT IS A FORM AND HOW DO CREATE IT IN ACCESS?

Forms are used to simplify data entry work or to display information in a specific manner.

Forms let you add, modify and delete data in a database.

Steps to create a Form

 In the Database window click Form under objects.

Click the New button on the Database window toolbar.



 In the New Form dialog box, Click Design View.

 Select the name of the table or query that includes the data you want to base your form on

and click on ok.

 Note: If you want to create a form that uses data from more than one table, base your form

on a query.

In the Form’s Design View, click Field list button on the toolbar (If it doesn’t appear).

 Select the field or fields from the field list, drag them and position then on the form.

 Size the textbox so that it is the appropriate size for the data you want to show.

 Change the label text if necessary.

 Switch to Form View or Datasheet View.

 Optionally you can add Form Header/Footer and Page Header/Footer. These options are

available on View menu

HOW TO CREATE REPORT IN MS ACCESS?

Steps to create a Report

1. In the Database window, click Reports under objects.

2. Click the New button on the Database window toolbar.

3. In the New Report dialog box, click Design View.

4. Select the name of the table or query that includes the data that has to be displayed in the

report.

5. In the Report’s Design view, click the Field list button on the toolbar (if it does not appear)

6. Select the field or fields from the field list, drag them and put them in the Detail section of the

Report.

7. Choose View Print preview to preview the report or File Print to print the report.

EXPLAIN ABOUT DIFFERENT SECTIONS IN REPORTS OF ACCESS?

PC SOFTWARE & “C” PROGRAMMING


PC SOFTWARE & “C” PROGRAMMING 56

The information in a report can be divided into sections. Each section has a specific purpose. In

design view, sections are represented as bands and each section is represented once. The following

are the different sections in the report.

Report Header: The report header appears once at the beginning of a report. You
1.
can use it for items like logo, report title or print data. The report header is printed before the page

header on the first page of the report.

Page Header: The page header appears at the top of every page in the report. it is
2.
used to display column headings.

3. Detail section: The detail section contains the main body of a report’s data. This

section is repeated for each record in the

Page Footer: The Page footer appears at the bottom of every page in the report. It is
4.
used to display page numbers.

Report Footer: The report footer appears once at the end of the report. It is used to
5.
display report totals. The report footer is the last section in the report design but appears before the

page footer on the last page of the printed report.

Group header: Group header appears at the beginning of a new group of records. It
6.
is used to display information that applies to the group as a whole, such as a group name.

Group Footer: Group footer appears at the end of a group of records. It is used to
7.
display group totals.

EXPLAIN THE DIFFERENT TYPES OF QUERIES AVAILABLE IN ACCESS?

The following are the important types of queries we can create in MS-Access.

1) Select queries 2) Action queries 3) Cross table queries 4) Parameter queries

Select query: It retrieves data from one or more tables and displays the results in a datasheet where

you can update the records. It can also be used to group records and calculate sums, counts,

averages and other types of totals.

Action query: It is the query that makes changes to many records in just one operation. There are

four types of action queries.

Delete query: Deletes a group of records from one or more tables. For eg. You could use a delete

query to remove products for which there are no orders.

Update query: Makes changes to a group of records in one or more tables. For eg. You can raise

salaries of all employees by 5%

Append query: Adds a group of records from one or more tables to the end of one or more tables.

PC SOFTWARE & “C” PROGRAMMING


PC SOFTWARE & “C” PROGRAMMING 57

Make-table query: Creates a new table from all part of the data in one or more tables.

Cross- tab Query : A cross tab query displays summarized values ( sums, counts and averages)

from one field in a table and groups them by one set of facts listed down the left side of the datasheet

and another set of facts listed across the top of the data sheet.

Parameter query: A parameter query is a query that when run displays its own dialog box prompting

you for information, such as criteria for retrieving records.

HOW DO YOU INSERT AN IMAGE OBJECT ON A FORM/REPORT?

1. Open the form/report in Design view.

2. Click on Image control in the tool box and then click on the form/report where you want to

insert the image.

3. In the insert picture choose the filename and click on ok.

WHAT IS A RELATION? HOW TWO TABLES ARE RELATED IN ACCESS?(OR)

EXPLAIN THE TYPES OF RELATIONSHIPS IN ACCESS?

A relationship works by matching the data in two different tables using a common primary field. These

are two kinds of relationships- One-To-One and One-To Many. In a One-To-One relationship, for one

record in a table A there is one corresponding record in table B, where as in One-To-Many

relationships for each record in table A there are many records in table B.

PC SOFTWARE & “C” PROGRAMMING


PC SOFTWARE & “C” PROGRAMMING 58

FEATURES OF "C"
1. Highly portable, flexible and efficient
2. Lean object code specific to target hardware
3. Invisible functionality like memory management, stack frames, CPU-register manipulation,
inline assembly, etc.
4. POINTERS are used to access memory and devices
5. It is a structured programming language that supports top-down programming technique

PC SOFTWARE & “C” PROGRAMMING


PC SOFTWARE & “C” PROGRAMMING 59

THE HISTORY of C

Multics (Multiplexed Information and Computing Service) was an operating system developed
in the mid-60 by MIT that delivered a computing interface not seen before. It was the first computing
environment to deliver things like 1) dynamic linking 2) inter-process (really universal daemon
processes) communication 3) complete memory file mapping 4) hot-swappable devices and 5) full
security throughout the OS. Applications were written in an ancient language called PL/1 and the OS
ran on GE mainframes. The size, complexity and cost made multics and its environment inhibiting for
most companies/organizations to employ.

Unics (Uniplexed Information and Computing Service and later trademarked as UNIX) was an
answer to the cost and complexity of Multics. Ken Thompson decided to write UNIX on the much-less
expensive DEC PDP/7 (in comparison to the GE mainframes). Dennis Ritchie helped Thompson on
this project. Unics (UNIX) was able to support two simultaneous users; one of which was Brian
Kernighan the OTHER one is Dennis Ritchie

At the time writing assembly language applications was not only tedious but required an
intimate understanding of the target hardware. Ritchie (Kernighan and Thompson) wanted to develop
a language that was not only highly portable but still allowed for CPU-register manipulation, memory
management and (relatively) easy I/O (input/output).

For this reason the new language is to be developed. The C-language was developed in
1972 at Bell laboratories by Dennis Ritchie. It is designed for the operating system called UNIX.
90% of UNIX was written in ‘C’. It is derived from the ‘B’-language which is written by Ken Thompson
at Bell laboratories. It is excellent and efficient and general purpose programming language. By using
‘C’, we can solve scientific, business, mathematical, research applications. The striking feature of C-
language is developing the system programs.

1. WRITE ABOUT C-TOKENS?


Token is a smallest individual unit in a program recognized by a complier. It is used to write
expression and statements. There exist six types of tokens they are

1. Key words 2. Identifiers 3. Operators

4. Constants 5.Strings-literal 6. Separators

PC SOFTWARE & “C” PROGRAMMING


PC SOFTWARE & “C” PROGRAMMING 60

KEYWORDS:
These keywords have some standard pre-defined meaning in C-language. This
meaning is assigned by the compiler. The user cannot modify the meaning of keywords.
There are 32 keywords in C-language they are

auto break case char const continue Default


do double else enum extern float for
goto if int long register return short
signed size of static struct switch type def union
unsigned void volatile while

IDENTIFIER:
(OR) WHAT ARE THE RULES FOR NAMING A VARIABLE?
Identifier is the name used to uniquely identify an item in a program. It is used to represent variables,
constants, function names etc.
Rules:
1. The first letter must be an alphabet
2. Keywords are never used as identifiers.
3. Maximum length of an identifier is 8 characters.
4. No special characters are allowed except underscore (_).
5. Underscore should not be used at the beginning (or) ending of a variable name.
6. Identifiers names are case sensitive

OPERATORS:- Operator is a symbols used within an expression to perform specific operation on


operands.
C has 15 simple operators ( ! % ^ & * - + = ~ | . < > / ? ), 11 compound assignment operators ( += -=
*= /= %= <<= >>= &= ^= |= == ), and 10 other compound operators ( -> ++ -- << >> <= >= != && || ).

SEPARATORS: Separator is a symbols used to separate different parts of a C program statements.


It has 9 separator tokens ( ( ) [ ] { } , ; : ).

CONSTANTS:
(OR) DEFINE CONSTANT? WHAT ARE THE DIFFERENT TYPES OF CONSTANTS ARE
AVAILBLE IN “C” LANGUAGE
Constant can be defined as the value of an identifier does not change while executing a program. It
is also called as literal. There are 3 types of constants. They are Integral constants, Floating point
constants, Character constants

Integer constants: It is used to represent positive or negative whole number without a fractional
part.

PC SOFTWARE & “C” PROGRAMMING


PC SOFTWARE & “C” PROGRAMMING 61

There are 3 types of integer constants.


(a) Decimal Integer Constants: It contains decimal number 0 to 9. By default every constant
is a positive decimal constant.
(b) Octal Integer Constants: octal integer constants must begin with 0. It contains decimal
numbers 0 to 7. For example 07, 015, 05 etc
(c) Hexa Decimal Integer constants: Hexa decimal integer constants must begin with 0X. It
contains 0 to 9 numbers and A to F. Hear A=10, B=11, C=12, D=13, E=14, F=15. For
example 0x1, 0xA, 0X1F, 0X54 etc
Float constants: It is used to represent positive or negative decimal number with an integer part, a
decimal point and a fractional part. For example 9.0, 12.13, 400.00 etc

Character constants: Character constant is a single character that is enclosed within single quotes.
(OR)
Character constants are used to represents single character. it must be enclosed in single
quotations. Every character a constant value has unique integer value associated with it, these are
known as ASCII CODE. The following are the ASCII values of the character
For example ‘A’, ‘9’, ‘B’, ‘+’, ‘x’, ‘0’, ‘ ’

String Constants or string literals: A string constant is a collection of characters enclosed within
double quotes. In C-language the end of string is indicated by a character known as ‘\0’ (back slash
zero) (null character). It is automatically provided by the compiler. Ex: “aditya”, “abc” , “D.No-2-40-23”
etc.
(OR)
it can be defined as collection of characters terminated by “ NULL” character. It is used to declare a
collection of character by student_name, do.no etc it must be enclosed with double quotations

2. EXPLAIN ABOUT STRUCTURE OF A C - PROGRAM?


A C- program is a collection of functions. Every function is a collection of statements. Every C-
program must have a function called main ( ) function. Following is the general structure of a C-
program.
Preprocessor Directives
global variables;
main ( )
{
local variables
statements;

PC SOFTWARE & “C” PROGRAMMING


PC SOFTWARE & “C” PROGRAMMING 62

}
fun ( )
{
}
fun1 ( )

{
}
In a C-program, preprocessor directives are executed before the C-program passes through
the compiler.
Mostly used preprocessor directives are: # include, # define
# include is mainly used for including necessary header files to our C-program
# define is used for macro definition
Global variables accessed by all the functions where as local variable are accessed within the block.
Every C-program has one (or) more functions. If a program has only one function, then it should be
the main function. Hence the execution of a C-program starts with the main function. The main
function has 2 parts.
They are: a) Declaration Part b) Statement Part
The declaration part contains the declaration of local variables required for necessary operations
The following is an example C-program:
#include <stdio.h>
main ( )
{
int a,b,c;
Scanf (%d%d” , &a, &b);
C=a+b;
Printf (“Sum is %d” , c);
}
Output: Sum is C

EXPLAIN THE STRUCTURE OF THE PROGRAM IN STEP BY STEP PROCESS?

1) # include: - it is used to insert a header files in “C” programming it contains pre defined structure
of all the commands used in a programme.
2) < > (Angular):- Represents to read a specified file from a root directory.
3) Global Variable:- It is a variable which can be access by all the functions in a programme.
4) “ “ (Quotations):- Represents read the specified file from a current working directory.
5) Functions:- it must be defined before function to access the function in the entire program.
6) Structures, Global Variables:- The scope of these variables is entire program.

PC SOFTWARE & “C” PROGRAMMING


PC SOFTWARE & “C” PROGRAMMING 63

7) Main ( ) :- it is a function every executable program contains this function by default the
programme start executing main function.
8) { } :- It represents a block
9) Statements:- It represents executable C program or C Statements
10) Each and every statement must be terminated with Semi-colon (). The extension of a “C” file is
“.C”

WRITE THE CLASSIFICATION OF DATA TYPES IN “C”-LANGUAGES (OR) EXPLAIN ABOUT


DATA TYPES IN “C”- LANGUAGES?

C DATA TYPES

Standard data types Derived


User defined Data type
Data type
Array
Structure
Union
void Pointer
Enum Function
Integral type Floating type

int char float double

In “C”- Language data types are classified into three types they are

1) Primitive (OR) Standard data types


2) Extended (OR) Derived data types
3) User defined data types
Standard data types: Standard data types are used to tell the compiler what type of data to be
handled by an identifier. These data types give complete details of the behavior of a data type. It is
used to handle only one value at a time by using single identifier. For example int, char, float, double
Derived data types (extended data types): Derived data types are used to extend the behavior of
an existing simple data type to get more functionality. It is used to handle more than one value at a
time using a single identifier. For example arrays
User defined data types: User defined data types are created by a user by using simple, derived,
user defined data types as per the user requirement. The user has to decide the functionality and
behavior of these data types. By using these data types to handle more than one data type using
single identifier For example structures and classes

Void: this data type is introduce in ANSI – C. it is used to represent the following things
1) To specify the return type of a function when it is not returning any value.
2) To indicate an empty argument list to a function
Qualifier: qualifiers are used to extend the behavior of standard data type. There are two qualifiers
namely size and sign.

PC SOFTWARE & “C” PROGRAMMING


PC SOFTWARE & “C” PROGRAMMING 64

Size: qualifier is used to extend the size of an existing data type Size qualifier: there are two
size qualifiers they are short and long. Short is used to decrees the size and ling is used to extend the
size to maximum. For example short int size is only 2 bytes irrespective of operating system. It is not
possible to apply size qualifier on char
Sign qualifier: sign qualifier used to make the data type as a signed number or unsigned
numbers. There are two sign qualifiers they are signed and unsigned. Unsigned qualifier is used to
make the number as a positive number. By default all number are positive. It is not possible to apply
sign qualifier on long, double.
Sizes of the data types

Sno Data type Size in bytes Range

1 Char 1 -128 to 127


2 Unsigned Char 1 0 to 255
3 Signed Char 1 -128 to 127
4 int 2 -32768 to 32767
5 Unsigned int 2 0 to 65,535
6 Signed int 2 -32768 to 32767
7 Short int 2 -32768 to 32767
8 long int 4 -2147483648to 2147483647
9 float 4 1.2e-38 to 3.4e38
10 double 8 2.2e-308 to 1.8e308
11 long double 10 3.4e-4932 to 1.1e+4932
Array: Array can be defined as collection of similar data items which are stored in continuous
sequence to memory locations. Example int x[10]
Struct: Struct can be defined as collection of dissimilar data items under a common name
Example struct test
{int a,
char b;
};
Union: Union can be defined as collection of dissimilar data items under a common name
Enum: It stands for enumerated data type. It is used to attach name to numbers
String: Collection of characters terminated by a null character
Function: a set of statements having well defined specific task. It is a sub program which performs a
specific task.

EXPLAIN ABOUT OPERATORS


(OR)
WHAT IS A OPERATOR AND EXPLAIN DIFFERENT TYPES OF OPERATORS

Operators can be defined as a symbol which is used to perform a specific operation “C- Language” is
having a list of operators. They are

1) Arithmetical operators 2) Relational Operators


3) Logical Operators 4) Incremental Operators

PC SOFTWARE & “C” PROGRAMMING


PC SOFTWARE & “C” PROGRAMMING 65

5) Assignment Operators 6) Comma Operators


7) Bitwise Operators 8) Ternary Operators

Arithmetic Operators:
These are used for numerical calculations. There are 2 types of arithmetic operations. (i) Unary (ii)
Binary
Unary: It requires only one operand.
Example: Unary nious (-) is the unary operator available in this category. Eg : -y, -5 etc. Here -
changes the sign of operand y.
Binary: It requires two operands. There are five operators in C-language that support Binary
Arithmetic Operation.
They are :
Operator Meaning
+ Addition
- Subtraction
* Multiplication
/ Division (Quotient)
% Modulus operation (Remainder)
Note : The percentage (mod) operator cannot be applied with real numbers (floats).
Let us consider the following two integer variables a and b with the values 17 & 4
respectively.
Expression Result
a+b 21 (integer)
a-b 13 (integer)
a*b 68 (integer)
a/b 4 (integer)
a%b 1 (integer)
In the case of / and % operators, the second operand must be a non-zero value.
Consider the following table.
Relational Operators:Relational operators are used to compare two values. The result of the
comparison is either true or false.
The following table give the list of relational operators :
Operator Meaning
> Greater than
< Less than
== Equal to
!= not equal to
<= less than or equal to
>= greater than or equal to
Let a=9, b=5 then the operations with relational operators are listed below.

PC SOFTWARE & “C” PROGRAMMING


PC SOFTWARE & “C” PROGRAMMING 66

Expression Result
a>b 1
a<b 0
a==b 0
a!=b 1
a<=b 0
a>=b 1
Logical Operators: The logical operators are used to combine two or more relational expressions. C-
language has three logical operators and they are listed below.
Operator Meaning
&& Logical AND
|| Logical OR
! Logical NOT
AND Operator : It gives the net result as true if and only if condition (1) and condition (2) are true.
C1 C2 C1&&C2

0 0 0
1 0 0
0 1 0
1 1 1
Let a=10, b=5 then the logical expression (a = = 10) && (b<a) gives the result as 1.
OR Operator: This operator gives the net result as false if and only if both the conditions have false
value. Otherwise the net result is true.
C1 C2 C1 C 2

0 0 0
1 0 1
0 1 1
1 1 1
Let a=7, b=12 then the logical expression (a < = b) (b>50) gives the result as 1.
NOT Operator: This is the only unary operator available in logical operators. This operator negates
the value of given condition. If the value of condition is false, the net result is 1 and if the value of
condition is true, the net result is 0.
C1 ! C1

0 1
1 0
Let a=10 then the logical expression! (a = = 10) gives the net result as 0.
Assignment Operator: A value can be stored in variables with the help of assignment operator. =
symbol denotes the assignment operator. The assignment operator has the following syntax.
Variable = expression;
For example a = 10; b = 20 ;x = a+b ;

PC SOFTWARE & “C” PROGRAMMING


PC SOFTWARE & “C” PROGRAMMING 67

Therefore x is assigned the value 30 which is the sum of a and b.


Compound assignment operator: it is a combination of operators. They contains +=,-=,*=./= etc
For example: a+=b  a= a+b
a-=b  a= a-b
a*=b  a=a*b
a/=b  a= a/b
Increment & Decrement Operators:
The increment operator (++) increments the value of the given variable by one and the decrement
operator (- -) decrements the value of the given variable by one.
For example a++ for a = a + 1 and a - - for a = a - 1
These operators are of two types :
(i) Pre increment / decrement
(ii) Post increment / decrement
1) Pre increment / decrement: Here the value of given variable is incremented first then this
incremented value is taken for the next operation.
Eg : (i) x = + + a ;
If the value of a=5, then in the above statement first a will be incremented by 1 (i.e) the recent
value of a is 6 which is assigned to the variable x.
(ii) x = - - a ;
If the value of a=5, then first a will be decremented by 1 (i.e) the recent value of a is 4 which
is assigned to the variable x.
2) Post increment / decrement: Here the old value of the given variable will be operated with the
specified operation and later the increment/decrement is carried out.
Eg : (i) x = a + + ; let a=5
Here first the old value of a is assigned to x and then incrementation take place x=8, a=6
(ii) x = a - - let a = 5
In the same way, the old value of a is assigned to x and then decrementation take place x=5,
a=4.
Conditional operator or ternary operator:The conditional operator are ? and : they are used for
check the condition true or fale
Example: a > b ? printf( “big is A”): printf(“big is B”)

Bitwise operators: Different types of bitwise operator in C –language are 1. &bit wise and, 2 | bit
wise or 3<< left shift 4>> right shift
For example a=3 the equal binary value is 0000 0000 0000 0010 then a<<1
Equal to 0000 0000 000 0100 it is equal to decimal 4

WHAT ARE THE INPUT AND OUTPUT STATEMENTS IN C?(OR) EXPLAIN ABOUT I /O
STATEMENTS IN “C”- LANGUAGE
I/O Statements: -
The following are the two popular formatted input / output statements.

PC SOFTWARE & “C” PROGRAMMING


PC SOFTWARE & “C” PROGRAMMING 68

i) Scanf
ii) Printf
Scanf:
Input data can be entered into the memory from a standard input device keyboard. C-
Language provides scanf statement for supplying the input data. This statement can read all types of
data values.
The general syntax of scanf statement can be given as follows:
scanf(“control string with format specifiers” , addresses of variables);
Format specifiers are used to provide some information to the scanf statement regarding the
type of data and size of the data. Each format specifier must begin with a percentage sign (%).
Some of the format specifiers are given below:
The scanf statement should have at least 2 parameters. First parameter is a control string
which includes format specification characters. Second parameter is the address of the variable. To
get the address of any variable, it must by preceded by ampersand sign (&).
Example: scanf (“%d” , &a);
In the above scanf statement, there are 2 parameters. One is the control string with %d
format. Specifier and another is an integer variable ‘a’ preceded by Ampersand Symbol.
The following example shows the way of reading multiple variables using a single scanf
statement.
# include <stdio.h>
main ( )
{
int a;
float b;
char ch;
double d;
scanf (“%d %f %c %lf” , &a, &b, &ch, &d);
}
Printf: -
C provides printf statement for displaying output data. Printf statement moves the data from
computer’s memory to the standard output device Monitor. The variable names are optional and the
variable name should not be preceded with ampersand symbol.
The general syntax of printf statement is as follows:
1. printf (string constant”);
2. printf (“control string”, list of variables);
Example:
1. # include <stdio.h>
main ( )
{
printf (“This is my first C- program”);

PC SOFTWARE & “C” PROGRAMMING


PC SOFTWARE & “C” PROGRAMMING 69

}
Output: This is my first C-program.

WHAT IS FORMAT SPECIFIER


Format specifier is used to tell the compiler what type of data to be read or print then the
below list give the details of format specifier
%c character %d integer
%e, f, g, h - float %o octal
%x hexadecimal %u unsigned
%s string %lf  double, long float
%i decimal, octal, hexa integer
Note:- If an equation contains more than one operator then it is evaluated by using the formulae
BEDMAS
B ----- BRACKET
E ----- EXPONENTIAL
D ----- DIVISION
M ----- MULTIPLICATION
A ----- ADDITION
S ----- SUBTRACTION
WHAT IS ESCAPE SEQUENCE?
It is used to design the output generated by a program. It meet be start with a ‘ \’ symbol. It can be
used only in output statements.
LIST OF ESCAPE SEQUENCE
\a --- Bell \t --- tab \r --- return \n --- new line
\’ ---- ‘ \” ---- “ \? --- ? \| ---- |

DISCUSS ABOUT THE INSTRUCTIONS AVALIABLE IN “C” FOR THE FLOW OF CONTROL?
(OR)
WRITE ABOUT CONTROL STATEMENTS IN “C” LANGUAGE?
(OR)
WRITE ABOUT THE CONTROL STUCTURE IN “C” ?
(OR)
EXPLAIN HOW TO CONTROL THE FLOW OF A PROGRAMME IN “C” LANGUAGE?
(OR)
WRITE ABOUT THE CONTROL STRUCTURE IN “C”?
Control structures are used to control the flow of execution of a program with in a block.
These control structures can be constructed by using control statements.
In “C” language control statements can be classified as
1) Conditional control statements

PC SOFTWARE & “C” PROGRAMMING


PC SOFTWARE & “C” PROGRAMMING 70

2) Iterative control statements (or) Looping Statements


3) Un conditional control statements

CONTROL STATEMENTS

CONDITIONAL STATEMENTS ITERATIVE CONTROL STATEMENTS UN CONDITIONAL STATEMENTS

IF FOR BREAK
IF ELSE WHILE CONTINUE
SWITCH CASE DO-WHILE EXIT ( )
GOTO
CONDITIONAL CONTROL STATEMENTS: it can be used to control the flow of a program based
upon a condition. If the condition value is equal to “TRUE (OR) 1 the statements in the “TRUE
BLOCK” are executed.
If the conditional value is equal to “FALSE (OR) 0 the statements in the “ELSE_BLOCK” are
executed
Ex: if, if _else, switch case
IF STATEMENT: if statement is further divided into 4 types
1) simple if 2) if else 3) nested if 4) ladder if

SIMPLE IF: If simple if the condition value is true the statement is executed otherwise if ignore
the statement
Syntax: if (condition) statements; Ex: if (a>b) a=20;

IF ELSE: if the condition value is true statement is executed ( true block) else the statement is
executed (false block)
Syntax: Example
if (condition) if (a>b)
Statements1; big =a;
Else else
Statements2; big =b;
NESTED IF: Nested or ladder if contains multiple of if statements one inside another. It is used to
check multiple conditions as a group.
Syntax: Example:
if (condition) If (a>b)
statements; Printf (“a is big”);
else if (b>c)
if (condition) printf (“b is big”);

PC SOFTWARE & “C” PROGRAMMING


PC SOFTWARE & “C” PROGRAMMING 71

statements; else
else if (c>a)
if (condition) printf (“c is big”);
statements;
SWITCH CASE: It is multi way branching statement. If used to check multiple conditions again a list
of case values. If a match is found the statement under the case are executed if no case is matched
then the default case is executed.
Syntax: Example:
Switch (variable) switch (ch)
{ {
case value : statements; break; case1: c=a+b; break;
case value : statements; break; case2: c=a-b; break;
default: statements; default: print (“invalid case”);
} }
ITERATIVE CONTROL STATEMENTS (OR) LOOPING STATEMENTS : The control statements are
used to repeatedly execute a finite set of statements for a finite no of times these statements are
divided into 2 types they are
1) Entry control statements 2) Exit control statements
Entry control statements: In this statement at first it checks the condition if the condition value is
true the statements in the loop executed otherwise if exit the loop
Ex: for, while
FOR: For statement contains 3 statements they are 1) initialization : it is used to initialize an
iterative. 2) Statement used to verify the condition 3) step value: used to increment / decrement the
iterative variable value.
Syntax: for (initialization; condition, step value)
Ex: for (i=0,i<10;i++)
Printf(“%d”,i);
WHILE: it is an entry control statement if the condition value is true the iteration begins otherwise it
exit the loop
Syntax: Ex:
Initialization; i=1;
While (condition) while(i<=10)
{ {
Statements; printf (“%d”,i);
Step value; i++;
} }

Exit Control Statement: In exit control statements first the control enters into the iteration and
check the condition. If the condition is true the iteration repeats otherwise if exits the iteration.
Ex:- do_ while

PC SOFTWARE & “C” PROGRAMMING


PC SOFTWARE & “C” PROGRAMMING 72

Syntax: Ex:
Initialization; i=1;
do do
{ {
Statements; printf(“%d”,i);
Step value; i++;
} }
While (condition) while(i<=10)
UN CONDITIONAL CONTROL STATEMENTS:
These statements are depending upon any one if the iterative statements (or) conditional
control statements. It can be used to jump the control to a specific location in a program (or) terminate
an iteration (or) entire program
(or)
It is used to transfer control from one place to another place with in a programme.
In “C” language there exists four statements
1) Break ( ) 2) Continue ( ) 3) Exit ( ) 4) Goto ( )
BREAK ( ) : it is used to terminate iteration (or) a “Switch Case” (or) it is sued to break an iteration(or)
a switch case solution once a break is executed the control automatically come out of the control
statement
CONTINUE ( ): it is used to ignore the current iteration and continue the next iteration.(or) it is used to
get the next iteration value in a iterative statement
EXIT ( ): it is used to terminate the program (or) it is sued to terminate the program by force once exit
executes the control automatically come to the command prompt
GOTO ( ): it is used to jump the control to a specific label area. (Or) it is used to jump the control to a
specific location this location can be identify by a label

WHAT IS THE DIFFERENCE BETWEEN WHILE & DO WHILE LOOPS?

WHILE LOOP DO_ WHILE LOOP

1) It is an entry control loop 1) It is an exit control loop


2) The minimum number of times executed is 2) The minimum number of times executed is
zero one
3) no semicolon at the end of while 3) It must be terminated by a semicolon
4) The following is the general 4) The following is the general of the do-while
syntax loop.

syntax of the while loop Initialization

Initialization do

while (condition) {

{ :

PC SOFTWARE & “C” PROGRAMMING


PC SOFTWARE & “C” PROGRAMMING 73

: Body of loop
Body of loop Increment;
: } while (condition);
Increment,
5) the initialization and increment sections are 5) in this case also the initialization and
used to initialize and modify the value of the increment sections are used to initialize and
loop control variable modify the value of loop control variable
6) the process of execution the body will be 6) the process of executing the body will be
continued until the condition value become continued until the condition value become
false false
7) in the case of while loop, if the condition is 7) in the case of do while loop the body will be
found to be false for the first time the body will executed at least once without depending on
never be executed and the loop will be the value of the condition
terminated
8) in the while loop the condition is placed at 8) in the do-while loop, the condition is placed
the beginning of the loop at the end of the loop
9) in most applications the while loop is an user 9) if the body is to be executed at least once,
friendly loop the do-while loop is much more suitable.
10) it is possible to have nested while loops 10) it is also possible to have nested do-while
while loop can also contain a do-while loop loops. Do while loop can also contain a while
loop

EXPLIAN ABOUT IF STATEMENTS?


‘If’ is a conditional control statement. There are different type of if statements are available in
c they are simple if, nested if, if else and if else ladder
Simple if:
In the simple if statement there is only true block/ the block of statement will be executed if
the condition is true
Syntax : if (condition) if (a>b)
Statement printf(“big is a”);
Nested if
It contains multiple if statements. It check another condition if it is true
Syntax : if (condition) if (a>b)
{if (condition) {if(a>c)
{if (condition) printf(“big is a”);

PC SOFTWARE & “C” PROGRAMMING


PC SOFTWARE & “C” PROGRAMMING 74

Statement}} }
If – else
It is a two way statement. The condition is true then true block is executed otherwise false
block is executed
Syntax : if (condition) if (a>b)
Statement printf(“big is a”);
Else else
Statement; printf(“big is b”);
Else – if ladder
In this statement the else block contains if statement i.e check the condition
Syntax : if (condition) if (a>b) && (a>c)
Statement printf(“big is a”);
Else else
{ if (condition) if (b>c) printf(“big is b”);
} else printf(“big is c”);

ARRAY
WHAT IS AN ARRAY? EXPLAIN DIFFERENT TYPES OF AN ARRAY?
An array is a group of related data items that are share a common name. or an array is a
collection of similar data elements and a particular value can be accessed by supplying a number
called subscript or an index. Array are 2 types they are (1) one dimensional array (2) two
dimensional array or multi dimensional array

TYPE OF ARRAYS: there are three types of arrays they are one dimension, double dimension and
multi dimension array

One Dimensional Arrays:- A list of items can be given one variable name using only one subscript
one- Dimensional Array.
Syntax: data type name [size]:
Where the data type specifies the type of the element that will be contained in the array such as int,
float (or) char. Name indicates the name of the array.
Size indicates the maximum number of elements stored in the array.
For example: float height [50];
Declares the ‘height’ to be an array containing 50 float elements
Initialising Arrays: The array can be initialised with some initial values at the time of declaration is
called initialisation
For example
1. int num [6] = {2,4,12,5,9,3};
2. int a[ ] = {11, 12, 13, 14};
3. Float Press [ ] = {12.3, 14.5, 16.7, 18.9};

PC SOFTWARE & “C” PROGRAMMING


PC SOFTWARE & “C” PROGRAMMING 75

Note the following points from the above examples:


1. While initializing an array, it is optional to mention the size of the array. The size will be
automatically assumed by the compiler.
2. An uninitialised array contains garbage values as its initial values.
3. It is also possible to initialize an array by having the initial values less than the size.
Ex: int a[5] = {11, 12, 13};
Reading Arrays: The following for loop explains the way of reading one - dimensional arrays :
int a[10];
:
for (i = 0; i<10;1++)
Scanf (“%d”, &a[i]);
Writing Arrays: (or) Displaying Arrays: The following for loop explains the way of displaying the
elements of the array:
int a[10];
for (i = 0; i<10;1++)
Printf (“%3d ”, &a[i]);
Double - Dimensional Arrays: an array having both rows and columns. The following is the general
syntax of declaring a two - dimensional array:
data type name [rows] [columns];
The following is an example of declaring a 3 x 3 matrix:
int a[3][3];
Sincerely the element at ith row and jth column can be referred as a [i] [j]
Initialising Arrays : Like one-dimensional arrays, two-dimensional arrays can also be initialised at
the time of declaration.
The following are some examples of initialising 2D arrays:

1) int a [3] [3] = {


{11,12,13} ,
{14,15,16} ,
{17,18,19}
};
The following points are noted from the above initialisation :
(i) While initialising 2-D arrays, it is optional to specify the no.of rows.
(ii) As per the above example (1), a[0] [0] will be assigned with 11, a[0] [1] with 12 ......... a[2] [2] with
19.
(iii) As uninitialised 2-D array contains garbage values.
Reading 2-D Arrays:
The following nested for a loop describes the way of reading 2-D arrays:
int a[3] [3] ;
:

PC SOFTWARE & “C” PROGRAMMING


PC SOFTWARE & “C” PROGRAMMING 76

for (i = 0; i<B; i++)


for (j = 0; j<B; j++)
Scant (“%d”, & a [i] [j]) ;
Writing 2-D Arrays: The following nested for loops display the elements of 2-D array in the matrix
format :
int a [3] [3] ;
:
for (i = 0; i < 3; i++)
{
for (j = 0; j < 3; j++)
printf (“%3d”, a[i] [j]),
printf (“\n”);
}
STRINGS
Write about string handling functions?
String can be defined as collection of characters terminated by a null character. It is an array of
characters.
Syntax char name [size] ;
Where name is the name of the string variable size determines the number of characters that the
string can hold.
When the compiler assigns a character string to a character array, it automatically supplies a null
character (‘\0’) which is denoted by “\0”. Hence the maximum no. of characters required are size +1.
Reading Strings:
Scanf: sting can be read by using scanf with %s format. For example:
char S [15] ; : scanf (“%s”, S)
In the above scanf statement, a collection of characters can be taken into the string ‘S’. The problem
with the scanf function is that it terminates its input on the first space character (or) first tab character
(or) enter key. Therefore if the following line of text is typed for the above scanf statement,
New York
Then, only the string ‘new’ will be taken into the string ‘S’. This is because the space character after
the word ‘New’ will terminate the string ‘S’. Hence the scanf statement cannot read Multi Word
Strings.
The scanf statement with %S format specifier does not need the usage of ampersand symbol before
the variable name. The name of the character array itself indicates the address.
GETS: gets is an unformatted input function and it can accept a string from the key board.
Syntax: gets (string name) ;
The gets function is able to read multi-word strings and it recognizes only the enter key as the
terminating character for inputting a string. For example
char S [80] ;
:

PC SOFTWARE & “C” PROGRAMMING


PC SOFTWARE & “C” PROGRAMMING 77

gets (S) ;
String Initialisation: C permits a string to be initialised in the following ways :
char name [7] = “aditya” ;
char name [ ] = {‘a’, ‘d’, ‘i’, ‘t’, ‘y’, ‘a’, ‘\0’} ;
From the above examples, the following points are noted.
In the example 1 the sting is automatically teminated by null character
In the example 2 the string is terminated by ‘\0’ null character supplied by user
Writing string:
The ‘printf’ function with %s format specification is used to display the string.
The following is an example:
char name [7] = “aditya” ;
:
printf (“%S”, name) ;
In the above example, name is initialised with a string constant “aditya” and it can be displayed by the
printf statement as: aditya

STRING HANDLING FUNCTIONS

WRITE ABOUT THE STRING HANDLING FUNCTIONS


The C-library supports a large number of string handling functions that can be used to
manipulate the strings in many ways.
The c-language library supports a large no of string handling functions that can be used to
manipulate the strings in many ways when ever the strings library functions are defined in our
program, than we must define “string.h” header file. The string library functions are given below

Library functions Actions


Strlen () find the length of the given string
Strcmp () compares the given two strings
Strcpy () copy a one string to another string
Strcat() concatenates the two strings
Strrev () reverse the given string.
STRLEN (): String length: this function counts and returns the no of characters in a string.
Syntax: int l=strlen (string variable);
In above syntax l is integer variable and it receives the value of the string length. and
string is a string variable or string constant.
Ex char s[20];
Int l;
Gets(s);
L=strlen(s);
Printf(“%d”,l);

PC SOFTWARE & “C” PROGRAMMING


PC SOFTWARE & “C” PROGRAMMING 78

STRCMP ( ): the strcmp () function compares two strings identified by the arguments and returns a
value 0 if they are equal. If they are, it returns the numeric difference between the first non matching
characters in the stings. It takes the form
Strcmp (string1, string2);
String1 and string2 may be string variables or string constants.
Example: strcmp(name1,name2); Strcmp(name1, “Rao”);
Strcmp(“memory”, “RAM”);
Our major concerns is to detriments whether the sting are equal; if not, which is alphabetically about.
For example the statement
Strcmp (“their”,” there”);
Will return a vale of -9 which is numeric difference between ASCII “I” and ASCII “r”
STRCPY() the strcpy () function works almost like a string assignment operator. It takes the form
strcpy(string1 string2)
And assigns the contents of string2 to string1. string2 may be a character array variable or a
string constant. For example, the statement.
Stycrpy(town, “Tenali”);
Will assign the string “Tenali” to the string variable town. Similarly the statement
Strcpy(town1,town2);
Will assign the contents of string variable town2 to the string variable town1. the size of array
town1 should be large enough to receive the contents of town2.
STRLEN (): this function counts and returns the number of character in a string.
N=strlen (string);
Where n is an integer variable which receives the value of the length of the string. The
arguments may be a sting constant. The counting ends at the first null character
STRREV () : string reverse : The strrev is the name indicates reverse the given string with in itself.
Syntax: strrev ( “string”);
FUNCTIONS
DEFINE FUNCTION? EXPLAIN HOW TO CREATE A FUNCTION IN “ C” LANGUAGE?
(OR)
EXPLAIN THE COMPONENTS OF A FUNCTIONS
Function can be defined as the ser of executable statements having well defined specific task
that can be processed separately (or) independently.
It can be designed, developed, and implemented independently by different programmers. It
is having a set of local parameters to perform the calculations with in the body.
ADVANTAGES OF FUNCTION:
1. Modular programming.
2. Program and function debugging is easier.
3. Division of work is simplified
4. Code reusability.
5. implement standard Library of functions

PC SOFTWARE & “C” PROGRAMMING


PC SOFTWARE & “C” PROGRAMMING 79

Components of function
There exist five components to define a function in “C” language. They are
1) function prototype 2) function declaration
3) function definition 4) function call
5) return
FUCNTION PROTOTYPE: It tell the compiler the name of a function, return data type, number of
arguments received and their data types. It must be written as first line of a programme.
Syntax: return type function name (data type, data type);
Example: int add (int, int); Void ad (int, int);
Void add ( ); int add ( );
FUNCTION DECLARATION / FUNCTION DEFINITION
The function definition contains the set of statements having well defined specific task. In
this the first line is called as the function declaration and the remaining is called as function definition.
Syntax: return type function name ( data type variable , data variable type);
{
Statement;
Statement;
}
Example:
Int add (int a, int b)
{
Int c;
C=a+b;
Return (c); }

Here, the declaration part is used to declare the formal parameters of functions.

FUNCTION CALL: Function definition gets the life only when it is to be called by using a function call.
The function call can be written inside the body of a function (or) main.
Syntax : function name (actual parameters);
Example: add (a,b);
Add ( );
Here the parameters are called actual parameters. In a programme if a function call occurs then the
control automatically transferred to the function declaration. After execution the function definition the
control automatically returns the calling area.
RETURN STATEMENT: It is used to return the value from a function to the calling area. The function
definition contains more than one return statement. In this case only one return statement Is
executed. If the function does not return only value than the return data type of a function is “void”
and function definition does not contain a return statements
Syntax: return (value / variable / expression)

PC SOFTWARE & “C” PROGRAMMING


PC SOFTWARE & “C” PROGRAMMING 80

Example: return (a);


return (b);
return (a+b)
WHAT IS ACTUAL PARAMETER? WHAT IS IT IMPORTANCE?
The parameters contains the original values is called actual parameters. It is used to send the
data to a function definition by using function call
WHAT IS FORMAL PARAMETER? WHAT IS IT IMPORTANCE?
The parameter receives the values from the actual parameter is called formal parameters. It
can be declared in the function declaration part.
WHAT ARE THE PARAMETERS PASSING METHODS?
(OR)
EXPLAIN CALL BY VALUE AND CALL BY REFERENCE METHODS?
In c language parameters can be passed to a function in 2 ways.
1) Call by value method 2) Call by reference method
CALL BY VALUE
1) The actual parameters must send value to formal parameters
2) Formal parameters must be of type data variables
3) Any changes applied on formal parameters cannot reflect back to actual parameters.
4) this method is used to secure the original values and get the result by using a function.
Example swap of two numbers
Void swap (int x, int y)
{
Int t;
t=x; x=y; y=t;
}
main ( )
{
void swap (int,int);
int a=10;b=15;
printf("a=%d b=%d",a,b);
swap (a,b);
printf("after swap a=%d,b=%d",a,b);
getch()

CALL BY REFERENCE METHOD (OR) CALL BY ADDRESS:


1) In this method the actual parameter must send an address of actual parameter by using address
operator ( & ).
2) the formal parameters must be of type pointer
3) any changes applied on formal parameters are reflected back to actual parameters.

PC SOFTWARE & “C” PROGRAMMING


PC SOFTWARE & “C” PROGRAMMING 81

4) this method is used to return more than one value from a function.
Example : swapping of two numbers
void swap (int *x, int *y)
{
int t;
t=*x; *x=*y; *y=t;
}
main ( )
{
void swap (int*,int*);
int a=10;b=15;
printf("a=%d b=%d",a,b);
swap (&a,&b);
printf("after swap a=%d,b=%d",a,b);
getch()
}

EXPLIAN ABOUT INLINE FUNCTIONS


Inline functions are special function in which at the time of compilation the function body is inserted in
place of the function call. An inline function definition is similar to an ordinary function except that the
keyword inline precedes the function definition.
Syntax inline function- header ( )
{ Body of the function;
}
The inline functions are similar to macros. But the major drawback with macros is that the error
checking does not occur during compilation.

The following cases inline functions may not work properly


1. Functions returning values, having a loop, a switch or a go to exists
2. If the function contains static variables
3. If inline functions are recursive
Benefits: - 1) Inline function makes a program to run faster, because function call and return is
eliminated
2) For the small functions it is always convenient to use inline functions.
Disadvantages: -
1. Inline functions require more memory because they expanded while compiling the
program
2. it is not good for function if the size of a function is increased
3. The inline key word sends a request but not a command to the compiler. Hence the
compiler can ignore the request if the function definition is too long
The following is an example program for defining inline functions

PC SOFTWARE & “C” PROGRAMMING


PC SOFTWARE & “C” PROGRAMMING 82

inline float getdata (int a, float b)


{ return (a+b); }
void main ()
{
int a= 35; float b= 18.5;
printf(“The sum is %d“getdata (a,b));
}
EXPLAIN RECURSION? WHO IT IS EVALUATED?
Calling a function into itself is known as recursion. For each function call a separate copy of local
variables are created. The following are the requirements to write a program using recursion.
1) The problem must be expressed in recursive nature
2) They should be one terminating condition to break the recursion.
3) By using backtracking mechanism to evaluate recursive function
The following is an example program for calculating the factorial using recursion
#include <iostream.h>
#include<iomanip.h>
void main()
{ int n,f;
int fact(int n);
printf(“enter n value...");
scanf(“%d”,&n);
f= fact (n);
printf("factorial= %d",f );
}
int fact (int n)
{ if (n==0) return (1);
else
return(n*fact(n-1)); }
Sample run: in the above program the value of n = 3 the expected output is 6

POINTERS

DEFINE POINTER? EXPLAIN HOW TO USE POINTER IN “C” LANGUAGE?


POINTER: pointer is a variable which can store an address of a variable (or) an address of memory
location. It is a derived data type which can be used to handle address. In “C” Language
(OR)
A pointer is a variable which holds the address of memory or any variable or a function.
1) Declaration of pointer variable
2) Initialization of pointer
3) Value stored at an address(*)
DECLARATION OF POINTER VARIABLE

PC SOFTWARE & “C” PROGRAMMING


PC SOFTWARE & “C” PROGRAMMING 83

In this stage a pointer variable of specific data type is created. Here the “ * “represents the
variable of type point.
Syntax: data type * point variable;
Example: int *p;

INITIALIZATION OF POINTER
Pointers are always initialized with an address of any variable by using & symbol
(OR)
In “c” language all the pointer variable must be initialized with valid address. If address is not
“no” then by using “NULL” to initialize the pointer variable. If you want to initialize a pointer variable
with an address of an existing variable by using address of operator “ & “
If you want to initialize a pointer variable by using address of a memory location by using
dynamic memory management operators.
1) Malloc ( ) 2) calloc ( ) 3) free()
Syntax: pointer variable = & variable;
Pointer variable = address of memory location
Pointer variable = NULL
Example: char *x = “hello”

VALUED STORED AT AN ADDRESS ( * ): To access the value stored at an address by using


“dereference” operators (or) value stored at an address an operator (*)
(OR)
Value at address operator is used to access the value pointed by a pointer.
Syntax: *pointer variable;

Example:

main() X *Y

{ 1234 abcd
Int x, *g; X
x=20; X=20  20
y=&x 1234
y=40; y=&x 1234
Printf(“x=%d”, x); X
} *y=40 40
1234

PC SOFTWARE & “C” PROGRAMMING


PC SOFTWARE & “C” PROGRAMMING 84

The size of a pointer variable is always 2 bytes. Irrespective of data type. In pointer arthimatics it is
not possible to apply operators other than is “ = ”, ”+” , ” - “, ” * ”
Usage of pointer
Pointer variable =”NULL”
Pointer variable = pointer variable
Usage of + / -
Let address is stored in pointer y is 100
y+1
y+1 * size of ( pointer variable)
y+1*z  100+2=102
y-2
102-3*2=102-6=96
Some common uses for pointers are:
 To access elements of an array or members of a structure
 To access an array of characters as a string.
 Passing parameter using call by reference method
 The size of any pointer variable is 2 bytes

Limitations of pointer variables:


 It is not possible to use pointers to refer variables declared as register storage class
 It is not possible to refer to a bit field
 A pointer can hold only one value at a time

WHAT IS POINTER ARITHMETIC? WHAT ARE THE DIFFERENT TYPES OF POINTERS?


Pointer arithmetic means that applying arithmetic operations on pointer variable. Only addition and
subtraction operations are allowed on pointers. Both addition and subtraction have a different
behavior with pointers according to the size of the data type of pointer variables. For example:
assume that *x is of type char pointer and *y is of type integer then
If x++ is equal to the address of x + 1* size of (char);
Similarly y - - is equal to the address of y-1* size of (int);

Type of pointers:

Pointers to pointers
Pointers to pointer or ** pointers. ** Pointers are used to declare a double dimensional array. Each *
represents one dimension
Syntax: data type * * variable;
For example int **x;
Void pointer:
Syntax: void *variable
For example: void *x;

PC SOFTWARE & “C” PROGRAMMING


PC SOFTWARE & “C” PROGRAMMING 85

The void pointer is a special type of pointer. It points to a value that has no type. It is used to point
any data type like integer, float, string etc.

WHAT IS NULL POINTER?


A null pointer is a pointer that it is not pointing to any valid reference or memory address.
Syntax: data type * variable = NULL
For example int *x = NULL:
Simple example for pointer
Int *p,x;
X=10;
P=&x;
Printf(%d”,*p); it will call the value ( i.e here 10)
Printf(“%u”,p); it will call the address (i.e here address of x)

STORAGE CLASSES

EXPLAIN ABOUT STORAGE CLASSES?


There are four types of storage classes they are
1) auto storage class
2) register storage class
3) static storage class
4) extern storage class

The storage class tell the compiler


1) where the variable Is stored
2) what is the initial value
3) what is the scope of a variable
4) what is the life time of a variable

AUTO STORAGE CLASS: it is the default storage class it can be defined by using the keyword
“auto” the feature of auto storage class variable is
1) storage – RAM
2) initial value --- garbage (unexpected value)
3) scope – local to the block
4) life time- till the control remains in the block
The default storage clause in C-language is auto.
Syntax auto data type variable name;
Example auto int x;

PC SOFTWARE & “C” PROGRAMMING


PC SOFTWARE & “C” PROGRAMMING 86

REGISTER STORAGE CLASS: it can be defined by using keyword register in this the variables are
stored in cpu registers. The time taken to tread a variable in less than the auto storage class the
features of register storage class are
1) Storage - cpu register
2) Initial value - garbage value
3) Scope – local to the block
4) Life time – till the control remains in the block
Syntax register data type varibalename;
Example register int x;
STATIC STORAGE CLASS:- It can be defined by using the keyword “static” these variable looks
like local variables and behaves like global variable. It always retain the previous state value to the
current state the feature of static storage class is
1) Storage --- RAM
2) Initial value ---- zero
3) Scope--- local to the block
4) life time – entire program
Syntax auto data type varibalename;
Example auto int x;
EXTERN STORAGE CLASS:- it can be defined by using the keyword “extern “ in this all the
variables behave like global variables the features of extern storage class is
1) storage -- RAM
2) initial value --- zero
3) scope --- entire program
4) life time --- entire program
Syntax extern data type varibalename;
Example extern int x;

STRUCTURES & UNIONS

DEFINE STRUCTURE? EXPLAIN HOW TO CREATE THE STRUCTURE IN C- LANGUAGE


STRUCTURE: structure can be defined as the collection of dis similar data items called
structure
Syntax struct <name>
{
Data items;
Data items;
};

PC SOFTWARE & “C” PROGRAMMING


PC SOFTWARE & “C” PROGRAMMING 87

1. At this stage the memory is not allocated for a structure.


2. The members of a structure are also called fields
3. The structure can be defined by using the keyword struct
4. The members of a structure are also known as fields or data member
5. ‘.’ Operator is called member of operator used to access fields of a structure
6. The size of the structure is defined as the sum of the sizes of the individual data members
In the above example the size of the structure is 22 bytes

CREATE A VARIABLE OF STRUCTURE:


Syntax: struct structure name variable;
Example: struct address x;
1) In this stage the memory is allocated to the structure
2) The size of a structure is equal to sum of the sizes of the individual data members of a
structure.

WHAT IS A UNION? HOW TO CREATE UNION IN “C” LANGUAGE?


Union can be defined as the collection of dissimilar data items in this the compiler allocates
memory for only one variable that occupies maximum size in the collection
Syntax: union union_name Example union student
{ {
datatype variable; int roll_number;
datatype variable; char name[10];
}; };
1. The union can be defined by using the keyword union
2. The members of a structure are also known as fields or data member
3. ‘.’ Operator is called member of operator used to access fields of a structure
4. The size of the structure is defined as the maximum size of the data member of the union
5. In the above example the size of the structure is 10 bytes

WHAT IS THE DIFFERENCE BETWEEN STRUCTURE AND UNION

STRUCTURE UNION

1) it can be defined by using the keyword 1) it can be defined by using the keyword
struct union
2) It can be defined as collection of dissimilar 2) It can be defined as collection of dissimilar
data items data items
3) The size of the structure is equal to the 3) The size of the union is equal to the
sum of the sizes of the individual data maximum size of the data member of the
members union

PC SOFTWARE & “C” PROGRAMMING


PC SOFTWARE & “C” PROGRAMMING 88

4) it is possible to access all data items at a 4) it is not possible to access all data items at
time a time because it share common memory
space

EXPLAIN THE FEATUERES OF STRUCTURES.


(1) The value of a structure variable can be assigned to another structure variable of the
same type using the assignment of operator.
Example d1.month=d2.month
(2) One structure can be nested with in another structure.
(3) like an ordinary variable. A structure variable can be also be passed to a function. We
may either pass individual structure elements (or) the entire structures at one go.

FILES
DEFINE FILE? HOW TO CREATE THE FILE IN “ C”
File can be defined as collection of recorder each record contains set of fields and each field
contains information the purpose of a file is to store data permanently on a secondary storage device.
1) CREATE A FILE: File can be created by creating a file pointer as
SYNTAX File * file pointer;
EXAMPLE File *fp;
2) OPENING A FILE: File can be opened on a secondary storage device by using f- open
command .A data file must be opened before it can be created or processed. This associated the file
name with buffer area. It also specifies how the data file will be utilized, i.e., as a read only file, a
write-only file, or a read/write file, in which both operations are permitted.
The library function f open is used to open a file . this function is typically written as
SYNTAX: file pointer = fopen (“filename.ext”, “mode”);
Example: fp= fopen (“text.txt”,”8”);
Here the f-open command contains two parameters
1) file name 2) mode
1) FILE NAME: the file name indicates the name and contents of file. The size of a file name is
a maximum o seven characters followed by … followed by three characters extension.
2) MODE: The mode are
R -------- open for read only purpose
W ---------- open for write only purpose
A –-------- open for appending purpose
W + ------- open for write and read purpose
B -- ------- open for binary file

3) CLOSING A FILE A data file must be closed at the end of the program. This can be
accomplished with the library function “fclose”.the syntax is simply
In general all the open files must be closed.

PC SOFTWARE & “C” PROGRAMMING


PC SOFTWARE & “C” PROGRAMMING 89

Syntax: fclose (file pointer)


Example fclose(fp);
It is good programming practice to close a data file explicitly using the fclose function,
though most ‘C’ compilers automatically close a data file at the end of program execution if a call to
fclose is not present.

WHAT ARE THE INPUT AND OUTPUT STATEMENTS USED IN A FILE


Input statements are used to read data from a secondary storage device into the memory for this
purpose we use the following commands
FPRINTF: Here printf is used to write any types of a data on a secondary storage device
The general form of fprintf statement is
Syntax fprintf(fp,”format string”, variable);
Example fprintf(fp,”%d%s”,rno, name);
Here rno and name values are write into the file through the file pointer fp
FPUTC f puts is used to write a character data.
The general form of fputc statement is
Syntax fputc(ch,fp);
Example fputc(‘a’,fp);
Here ‘a’ value write into the file through the file pointer fp
FSCANF: it is used to read all types of data
The general form of fscanf statement is
Syntax fscanf(fp,”format string”, variable);
Example: fscanf(fp,”%d%s”,&rno,&name);
In this example the rno and name values are read form file using file pointer fp
FGETC” it is used to read only one character data
The general form of fgetc statement is
Syntax ch= fgetc(fp);
Example ch=fputc(fp);
Here character ch value read form file through the file pointer fp

BINARY FILES
Binary files are used to store data on a hard disc in ASCII format. It is non readable
format. So that if any one try to modify the data then it is very difficult to parameters. In binary files the
data is dived into 8 bits and stored in hared disk. In C-language binary file can be created by suing
the file mode “ rd and wb”
1) fread 2) fwrite 3) feof
Fread: it is used to read data from a binary file here we can read more nf of records specify the no of
record value
Size of each record represents what a record occupies
Syntax: fread(file pointer, no of records, size of each record);

Fwrite: syntax: fwrite(file pointer, no of records, size of record);

PC SOFTWARE & “C” PROGRAMMING


PC SOFTWARE & “C” PROGRAMMING 90

ENUM

WRITE ABOUT ENUM STATEMENT?


Enum stands for enumerated data type which is used to attaching name to numbers.
1) Enum is a user defined data type
2) It members are constants written as identifier
3) The names of identifier are unique
4) If the initial values it is not specified then the values of members are ranging from 0 to
N where N is the maximum number of number
5) If the initial value is given then the range is starting from initial value to N . where n is
the maximum number of members.
6) It is not possible to read the value of enumeration members
The syntax of enum statement is
Syntax enum < name> Example enum color
{ {
Red;
Names; White;
}; Green; };

The numbers are 0,1,2, .. Which are automatically incremented by 1. In the about example the value
of Red =0, White=1, Green =2
Example 2: enum color
{
Red;
While = 15;
Green;
}
In the about example the value of Red =0, White=15, Green =16

WHAT IS TYPE CASTING


Type casting is used to convert the data type of variable from one form to another form with out
redeclaration. By using the required data type before the variable to convert into another data type
Syntax: (datatype) variable; Ex: (float) 3;

WHAT IS COMMAND LINE ARGUMENTS?


In “C” program the function main receive two arguments.
1) arguments count
2) arguments vector
Arguments count contains the maximum no of arguments and argument vector contain details the
first argument vector is arg v[0] contains the file name.
Ex: main (int arg c, char, arg v[])

PC SOFTWARE & “C” PROGRAMMING


PC SOFTWARE & “C” PROGRAMMING 91

{
Int sum=0
Sum-argv[2]+argv[]
Printf(“%d”, sum);
}
F:\> test 1,2

WHAT IS AOF
AOF is a macro. It i assed automatically at the end of a file at the time of creating from a file.
To read data from a file the aof is used to identify the end of a file

WHAT IS A PRE-PROCESSOR
Pre processors are used to include the header files in a programme.
For Example: # include <stdio.h>
It contains printf and scanf Similarly # include <conio.h>
It contains clrscr ( );
WHAT IS THE ROLE OF PREPROCESSOR DIRECTORIES?
Preprocessor directories are a set of statements executed before executing a “C” program it starts
with # symbol it must be written as the first line of a program. The directive name specifies the type of
operations to be preformed. It must be written as only one line statement. If you want to continue the
second line by using back slash (\)
1. include header files by using # include statement
2. to define macro, named constant by using # define statement
3. conditional compilation by using #i if def # if undef
4. line control or combine the source code of more than one language by using #
program statement.
5. detect errors at the time of compilation

WHAT IS A NAMED CONSTANT


It is used to represent the constant values with a specific name at the time of execution the system
automatically substitute the constant value at the place of name constant.
Syntax: # define PI 3.144
# define name value
WHAT IS A MACRO
A macro is name given to a set of executable commands it can be written by using # define
preprocessor statements when ever the macro name is used in a program it is replaced with defined
set of commands.
Syntax: # define macro name (arguments) statements
Ex: big (x,y)(x>y) ? printf(“big=x); printf(big=y”)

PC SOFTWARE & “C” PROGRAMMING


PC SOFTWARE & “C” PROGRAMMING 92

WHAT IS BITWISE OPERATORS


Bit wise operators are used to evaluate the conditions on integer, character data types they
are used to reduce the size of the program. They are two types of bitwise operators
1) Unary operators 2) Binary operators
a) & , && (AND) : if all the values are true the result is true
b) ||, | (OR) : if any one the value is true the result is true.
c) ^(EXCLUSIVE OR) : if both the input values are false or if both output result is true.
d) ! (COMPLEMENT) : the true value becomes false and false value becomes true
e) <<(LEFT SHIFT OPERATOR): shift the bits towards left side one bit at a time
f) >>(RIGHT SHIFT OPERATOR): shift the bits towards right side one bit at a time

WHAT IS DIFFERENT BETWEEN PRE AND POST INCREMENT


PRE INCREMENT POST INCREMENT
1) Operator ++ placed before the operand is 1) The operator ++ placed after the operand is
called pre increment operator ++x called post increment operator x++
2) The affected value available in the same line The affected value available in the next line
++10=11 10++=10

WRITE ABOUT DYNAMIC MEMORY MANAGEMENT?


Allocate the memory at the time of execution is called dynamic memory allocation. In C-language
memory is allocated by using malloc and calloc. The allotted memory must be deleted by using free
command
Initialize the pointer at run time (MALLOC)
Syntax: ptr = (datatype) malloc (size of (datatype));
Ex: x= (int) malloc(size of (int));
Int *x;
It is used t allocate the required amount of memory at run time . the allotted memory must be type
casted to the required data type it never initialize the allotted memory.
CALLOC :
Syntax: ptr=calloc (size of (data type));
Ex: x=calloc(size of (int));
It is used t allocate the required amount of memory at run time . the allotted memory automatically
initialized to zero and converted to required data type.
FREE ()
Syntax: free (ptr);
Ex: free(x);
The dynamically allocated memory must be free after the completion of usage other wise the
system generates the garbage collection so that the memory is not available to other applications. By
using free command to free memory

PC SOFTWARE & “C” PROGRAMMING


PC SOFTWARE & “C” PROGRAMMING 93

PC SOFTWARE & “C” PROGRAMMING

You might also like