BSC Istyear
BSC Istyear
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
A computer can be build to process an algorithm. The basic operations of a computer are
Storing data: used to save data and instructions for later use
Input Unit: Reads the list of instructions and data from the user and converts these instructions to
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
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 (>=)
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
There are two types of components in a computer. They are hardware and software
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).
3. Storage: large amount of data can be store temporarily or permanently in the system. Using
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
9. networking is used to connect different types of system in a single network to share the resources
1. Based on the mechanism 2.Based on the purpose of usage 3.Based on the size
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
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
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
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
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
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
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
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
3. it generates lo of heat
Second generation This generation is from 1955-1964. This generation transistor are used as an
electronic components
Limitations:
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
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
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
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
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: 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)
Alphanumeric keys (a to z)
Numeric keypad (0 to 9)
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
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
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
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,
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
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
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
Microphones and Speech Recognition: It is used to receive audio input and translate it in to digital
Video Input or web cam: Applications like video conferencing and video chat needs video files to be
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
Printers:-
Impact printers: there is a physical contact between printer head and printer media
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
Inkjet printers: It is non impact printer. It sprays small droplets of ink onto paper to create an image.
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
revolution for a line to be printed. This is called on the fly printing as the drum continues to rotate at a
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.
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
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
Speaker: It is used to convert digital signals to audio signals. It converts the signals by using a sound
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.
Volatile memory: The information is a volatile memory is lost when power switched off. A semi-
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
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
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
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
The factory programmed ROM's are manufactured using appropriate tasks. They are most reliable
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
divided into 7 to 9 tracks. Each track represents one bit of information. The last track is used to as
Advantages:
2. It is economical
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
Floppy disk:
Hard disk
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
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
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
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
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
Application Software:-Application software is the set of programs necessary to carry out operations
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
system
WHAT IS A LANGUAGE?
Language is the communication media between two individuals. Every language is having a well
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
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
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
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.
WHAT IS AN ASSEMBLER?
Assembler is used to convert assembly level language program to machine level program.
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.
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
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.
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
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,
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
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
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
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
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
the service. If the allotted time is not sufficient then it is served only after completing the service of all
(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
DOS
The DOS commands are divided into two types they are internal and external commands
Internal DOS commands: these commands can be executed any time after prompt appear on the
1) Date command: the purpose of this command is to display the system date and allows the user to
Example: C:\>date
2) Time command: The purpose of this command is to display the system time and allows the user
4) CLS: this command is used to clear the screen and display the cursor top of the screen
Example: C:\>cls
7) Copy: the purpose of this command is to copy the information from one file to other file
8) Type: the purpose of this command is to display the contents of a file on screen
10) Md (make directory): the purpose of this command is used to create user defined directory
11)Cd change directory: the purpose of this command is used ot change the directory
12) cd.. : the purpose of this command is used to return back to the previous directory
Syntax: C:\>cd..
13) cd\ : the purpose of this command is to return back to the root directory
Syntax: C:\>cd\
14)rd: remove directory the purpose of this command is delete the directory.
15) Dir: the purpose of this command is used to display the list o file name and directory name
Syntax: C:\>dir
16) dir/p: this command is used to display the files and directories page by page format
17)dir/w: this command is used to display the files and directories width wise format
18) dir/l: this command is used to display the files and directories in lower case format
21) dir/a-d: this command is used to display the files except directories
WILD CARDS OPTIONS: there are two types of wild cards in DOS they are * and ?
Example: c:\>dir a*.c display all c files whose file name starting with a
Output rama
Example: rama$p$g hear $p represent drive name(C) and $g represent > symbol
Output: C :\>
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
First the disk1 information is stored in RAM and transfer into target disk
3) Diskcomp: this command is used to compare the information of two disks on tract to tract basis
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
7) Attrib: this command is used to apply the attributes one or more files. The attributes are r- read
8) Find: this command is used to find the given work in a given file
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 user friendly because all the commands are represented in the menu
It support object linking and embedding OLE and dynamic data exchange DDE
WHAT IS AN ICON?
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
Recycle bin is used to store the delete files. It is introduced in the Windows 95 operating system it
Restore: the purpose of restore option is to retrieve the files or folders to previous position
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
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
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
The start button used to open the start menu. It is used to access your programs, settings and more
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
Start button: it is the entry point in windows operating system. It is a button on task bar contains
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
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
StartSettings 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
Mouse: - it is used to set the mouse pointers and speed of double click
The operations performed on file or a folder are create, copy, rename, delete etc
Right click the mouse and select new-and select folder to create a new folder
Right click the mouse and select new-and select file to create a new file
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
2. Select any application and click on right mouse button and select explore
2. It is used to see all the application, files, folders, drivers in the system
Dos Windows
system system
MS-OFFICE
MS-Word: it is a general purpose word processor. It is used to design letter, cards etc
MS-publisher: it is desk top publishing software for news, letters, post cards etc.
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
10. Word also has the facility of macros. Macros can be either attached to some function/special
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
19. Header and footer feature used to add header, footer for each page in a document
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.
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
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
12. Properties used to set the properties of a document like author etc.
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
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 5 Select save option under File menu to display save as dialog box
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 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 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
Page setup is used to set the paper size, margins, and header and footer options of a document in
1. Select page setup option under file menu to display page setup dialogue box
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
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
Step 6 Select page range to print the selected pages in that range
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
Step 2 Select New option under File menu to display New Document dialogue box
Step 5 Select header footer option under view menu to activate header and footer section in a
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.
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 6 Select header section and enter & design even page header
Step 7 Select footer section and enter & design even page footer
Step 9 Select header section and enter & design odd page header
Step 10 Select footer section and enter & design odd page footer
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
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 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
Step 1 Choose font option under format menu to display font dialogue box
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,
c. Font color: font color option used to apply different color to the text
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
Step 1 Choose toolsspelling and grammar option to display spelling and grammar dialogue box
window
Step 3 In the dialogue box windows show any spelling mistake in a document, suggestions to correct
ii. Change: the purpose of change button is replace the word from the list
Autocorrect feature is used to automatically correct misspelled words, number format, style etc in MS-
Choose toolsauto 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 on Ok button
For example if you type “there” in Replace box and type “three” in with box and click add. Then
Book mark is a marker or address that identifies a document or a specific place in a document. It is
Step 1 Choose insertbookmark option then it display bookmark dialogue box window
Step 3 Select the bookmark name and click on go to button to go to bookmark location
The hyper link is a clickable peace of text or a graphical image that links a document to another
Create a hyperlink
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
Step 6 The hyperlink can be click by using Ctrl + click to open the linked document
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 filesave as option show save as dialog box window to save the
There are four types of breaks in MS Word they are page breaks, column break, text wrapping break
Page break: used to break the page in to two pages even if the page is not completely filled
Section break: there are four types of section breaks. They are next page, continuous page,
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
1. Place the cursor in a document where you would like to insert the table
4. Select required number of rows and columns and click left mouse button
1. Place the cursor in a document where you would like to insert the table
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.
1. Place the cursor in a document where you would like to insert the table
3. Select draw table option and the mouse pointer looks like a pen
6. Choose the color for outside boarder using outside boarder color button
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
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
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)
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
Main document: It is a document letter you want to send it to all peoples. This can be a form letter,
Data source: It is a file that contains the data i.e. merged into the document
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
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>>
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
Example
Principal
Srinu
Line 3
Kakinada
Principal
A macro is a series of word commands grouped together as a single command. We can assign a
2. Enter the name for the macro in the record macro text box
4. To assign the macro to shortcut keys, click Keyboardname of the macro you are recording.
Running a macro
Delete a macro
Editpaste (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
These two options are exit in the edit menu edit undo (ctrl+z) and editredo (ctrl+y). Undo erases
the last change done to the document where as redo reverse the undo
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-
Graphical objects are used to add images, lines, shapes by using drawing toolbar. It is available
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
WordArt: Used to design a user defined text to a predefined font, color, design
chart
Insert a clipart: clipart means a predefined picture. It is used to insert clipart to the document
Fill color: used to fill the selected object with the selected color
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
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’.
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)
Operator is a symbol used to perform a specific operation like addition, subtraction, and multiplication
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
Operator Meaning
= Equal
Example The formula=A1<25 produces the logical value TRUE if cell A1 contains a value less than
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
Custom list is the list used to fill the worksheet with auto fill handle created by the user. It can be
For example if you want to insert North, South, East and West are needed to be entered frequently
1) Enter the list “North South East West” into a range of cells, in a row or column.
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
1) Relative addressing: -in this addressing method the address changes relative to the location
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
3) Mixed Addressing:- Mixed Addressing is a combination of relative and absolute address. The
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 =
2) Parentheses are used to enclose all arguments and commas are used to separate
1) Mathematical
2) Statistical
3) Financial
5) Logical
6) Text
Mathematical functions: These functions are used to calculate general, matrix and trigonometric
Sum (): it displays the sum of the given number or given range
Product (): it displays the product of the given number or given range
Absolute (); it display the value ignore the sign of that number
Syntax:=fact(number)
Syntax: =sqrt(number)
Syntax: =even(number)
Syntax: =odd(number)
Statistical Functions: These functions are used to perform statistical operations. They are
Syntax: =max(a1,a2,a3)
Syntax: =min(a1,a2,a3)
Syntax: =avg(a1,a2,a3)
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
Pmt() it is used to display the payment required for a loan amount given the interest rate and loan
term
Pv(); the present value given a series of equal payments, the interest rate and the term.
Date and time functions use date serial number to calculate various date and time related numbers.
Syntax: =date(year/month/date)
Syntax: =now()
Syntax: =today()
Syntax: =hour(number)
Syntax: month(number)
Logical Functions: Logical functions are used to display the status of the given condition
or(): it returns true value if any one of the conditions will be true
Syntax: =not(cond1)
Syntax: =true
Syntax: =false
Text Functions: Text functions are used to convert and manipulate text strings.
Syntax: =lower(text)
Syntax: =upper(text)
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.
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
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:
Type name for the Scenario; For this example, use Finance.
Hold the Ctrl key, and select cells B3:B4 Note: There is a limit of 32 changing cells
The Scenario Values dialog box opens, with a box for each changing cell.
You could modify these values, but in this example they contain the values currently on the
Show a Scenario
Once you have created Scenarios, you can show them. In this example, the Marketing scenario is
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
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.
Process:
2. Adjust the width in Column A to a suitable width for all columns. The form will use this width
Sort the data: sorting means arrange the data in ascending or descending order.
Select datasort to display sort dialog box window it contains the following options
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
Select datasubtotal to prepare the subtotals. To get the subtotal we have to follow
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
For example
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:
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.
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.
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
3) The first row in the data list should contain field headings.
7) Click on OK
Auto format is used to format the table by using pre-defined styles. To apply the auto format in the
following way
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:
1991
0 500 1000
Column Charts:
REGIONAL SALES
A column chart consists of a series of vertical
2000
Line charts:
200
100
Pie charts:
Product Sales
A pre chart is best used for comparing the
number is a slice.
Floor
29 %
X Y chart
line
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
Click Press and hold to view sample button to view the preview of select chart and click next to go to
next step
Step 2 of 4
Under data range tab Select the data range of the chart
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
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.
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
Step 4 of 4
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
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
Presentations: A Power point presentation is a collection of slides, handouts, speaker’s notes all are
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
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
5. The slide master is used to design the style of all the slides in a presentation
12. Color Schemes used to change the color combinations of various slides.
PowerPoint animation is a form of animation which is used to create a presentation. There exist two
Animations are two types they are slide transitions and custom animations
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
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
Under introduce text section select the type of text entry as word by word or character by
Chart effects
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
Transitions
In Slide or Slide Sorter view, select the slide or slides on which you want to add a transition.
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
To apply the transition to the selected slide, click Apply. To apply the transition to all the
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.
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.
which data is stored in the form of tables and the relationship among the data is also stored in the
form of tables.
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
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
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
Main/ Sub form- Displays both main and related table data.
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
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
Modules: It is used to design the forms, report etc as per the user requirement by using Visual Basic
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
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
Determine the fields that you need in each table each field contains a specific kind of information
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
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
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.
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.
6. When it prompts whether to save the changes, click on ’Yes’ button. In Save As dialog
7. Double click on table object icon or select it and click on open button and then enter the
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.
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
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
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
HYPERLINK: Use for hyperlinks. A hyperlink can be a UNC path or a URL. Stores up to 64,000
characters
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
To link two tables, the master tables should have a primary key. For example consider the following
tables.
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
Forms are used to simplify data entry work or to display information in a specific manner.
Select the name of the table or query that includes the data you want to base your form on
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.
Optionally you can add Form Header/Footer and Page Header/Footer. These options are
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.
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
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
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
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
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.
The following are the important types of queries we can create in MS-Access.
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,
Action query: It is the query that makes changes to many records in just one operation. There are
Delete query: Deletes a group of records from one or more tables. For eg. You could use a delete
Update query: Makes changes to a group of records in one or more tables. For eg. You can raise
Append query: Adds a group of records from one or more tables to the end of one or more tables.
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
2. Click on Image control in the tool box and then click on the form/report where you want to
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
relationships for each record in table A there are many records in table B.
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
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.
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
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
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.
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
}
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
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.
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”
C DATA TYPES
In “C”- Language data types are classified into three types they are
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.
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
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
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.
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 ;
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.
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”);
}
Output: This is my first C-program.
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
CONTROL 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”);
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
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
Initialization do
while (condition) {
{ :
: 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
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};
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
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
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)
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()
}
POINTERS
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”
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
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
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;
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.
STORAGE CLASSES
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;
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;
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
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
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.
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);
ENUM
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
{
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