CMS Lab Manual
CMS Lab Manual
1. INTRODUCTION
Data : It is the collection of raw facts, figures & symbols. Ex : Names of students and their marks in different
subjects listed in random order.
Information : It is the data that is processed & presented in an organized manner. Ex : When the names of
students are arranged in alphabetical order, total and average marks are calculated & presented in a tabular
form, it is information.
CHARACTERISTICS OF COMPUTERS
The characteristics of computers that have made them so powerful and universally useful are speed,
accuracy, diligence, versatility and storage capacity. Let us discuss them briefly. Speed:Computers work at
an incredible speed. A powerful computer is capable of performing about 3-4 million simple instructions per
second.
Accuracy: In addition to being fast, computers are also accurate. Errors that may occur can almost always be
attributed to human error (inaccurate data, poorly designed system or faulty instructions/programswritten
by the programmer)
Diligence: Unlike human beings, computers are highly consistent. They do not suffer from human traits of
boredom and tiredness resulting in lack of concentration. Computers, therefore, are better than human
beings in performing voluminous and repetitive jobs.
Versatility: Computers are versatile machines and are capable of performing any task as long as it can be
broken down into a series of logical steps. The presence of computers can be seen in almost every sphere –
Railway/Air reservation, Banks, Hotels, Weather forecasting and many more.
Storage Capacity: Today’s computers can store large volumes of data. A piece of information once recorded
(or stored) in the computer, can never be forgotten and can be retrieved almost instantaneously.
Cost effectiveness : Computers reduce the amount of paper work and human effort, thereby reducing costs.
Automation : Computers can be instructed to perform complex tasks automatically ( which increases the
productivity).
Limitations of computers : 1. Computers need clear & complete instructions to perform a task accurately. If
the instructions are not clear & complete, the computer will not produce the required result. 2. Computers
cannot think. 3. Computers cannot learn by experience. .
2.COMPUTER ORGANIZATION
A computer system consists of mainly four basic units; namely input unit, storage unit, central processing
unit and output unit. Central Processing unit further includes Arithmetic logic unit and control unit, as
shown in Figure 1.2
A computer performs five major operations or functions irrespective of its size and make. These are
GENERATIONS OF COMPUTER
Introduction:
A computer is an electronic device that manipulates information or data. It has the ability to store, retrieve,
and process data. Nowadays, a computer can be used to type documents, send email, play games, and
browse the Web. It can also be used to edit or create spreadsheets, presentations, and even videos. But the
evolution of this complex system started around 1940 with the first Generation of Computer and evolving
ever since.
1. FIRST GENERATION
• Introduction:
2. J.P.Eckert and J.W.Mauchy invented the first successful electronic computer called ENIAC,
1. ENIAC
2. EDVAC
3. UNIVAC
4. IBM-701
5. IBM-650
• Advantages:
1. It made use of vacuum tubes which are the only electronic component available during
those days.
• Disadvantages:
4. It could store only a small amount of information due to the presence of magnetic drums.
disadvantage of these computers was, vacuum tubes require a large cooling system.
6. Very less work efficiency.
7. Limited programming capabilities and punch cards were used to take inputs.
2. SECOND GENERATION
• Introduction:
1. Honeywell 400
2. IBM 7094
3. CDC 1604
4. CDC 3600
• Advantages:
1. Due to the presence of transistors instead of vacuum tubes, the size of electron
2. Less energy and not produce as much heat as the first genration.
• Disadvantages:
3. THIRD GENERATION
• Introduction:
1. PDP-8
2. PDP-11
3. ICL 2900
4. IBM 360
Advantages:
4. IC not only reduce the size of the computer but it also improves the performance of
6. Instead of punch cards, mouse and keyboard are used for input.
7. They used an operating system for better resource management and used the
• Disadvantages:
4. FOURTH GENERATION
• Introduction:
1. 1971-1980 is the period of fourth generation computer.
4. Graphics User Interface (GUI) technology was exploited to offer more comfort to users.
1. IBM 4341
2. DEC 10
3. STAR 1000
4. PUP 11
• Advantages:
1. Fastest in computation and size get reduced as compared to the previous generation
of computer.
• Disadvantages:
Introduction:
3. The aim of the fifth generation is to make a device which could respond to natural
1. Desktop
2. Laptop
3. NoteBook
4. UltraBook
• Advantages:
• Disadvantages:
Computer networks two or more computers that are connected with one another for the purpose of
communicating data electronically. Besides physically connecting computer and communication devices, a
network system serves the important function of establishing a cohesive architecture that allows a variety
of equipment types to transfer information in a near-seamless fashion. Two popular architectures are ISO
Open Systems Interconnection (OSI) and IBM’s Systems Network Architecture (SNA).
Two basic network types are local-area networks (LANs) and wide-area networks (WANs). LANs connect
computers and peripheral devices in a limited physical area, such as a business office, laboratory, or
college campus, by means of links (wires, Ethernet cables, fibre optics, Wi-Fi) that transmit data rapidly. A
typical LAN consists of two or more personal computers, printers, and high-capacity disk-storage devices
called file servers, which enable each computer on the network to access a common set of files. LAN
operating system software, which interprets input and instructs networked devices, allows users to
communicate with each other; share the printers and storage equipment; and simultaneously access
centrally located processors, data, or programs (instruction sets). LAN users may also access other LANs or
tap into WANs. LANs with similar architectures are linked by “bridges,” which act as transfer points. LANs
with different architectures are linked by “gateways,” which convert data as it passes between systems.
WANs connect computers and smaller networks to larger networks over greater geographic areas,
including different continents. They may link the computers by means of cables, optical fibres, or satellites,
but their users commonly access the networks via a modem (a device that allows computers to
communicate over telephone lines). The largest WAN is the Internet, a collection of networks and
gateways linking billions of computer users on every contin
UNIT-II
Ms-Word not only supports word processing features but also DTP features. Some of theimportant features
of Ms-Word are listed below:
i) Using word you can create the document and edit them later, as and whenrequired, by adding more text,
modifying the existing text, deleting/moving some part of it.
ii) Changing the size of the margins can reformat complete document or part of text.
iii) Font size and type of fonts can also be changed. Page numbers and Header andFooter can be included.
iv) Spelling can be checked and correction can be made automatically in the entiredocument. Word count
and other statistics can be generated.
v) Text can be formatted in columnar style as we see in the newspaper. Text boxescan be made.
vii) Word also allows the user to mix the graphical pictures with the text. Graphicalpictures can either be
created in word itself or can be imported from outside like from Clip ArtGallery.
ix) Word also has the facility of macros. Macros can be either attached to some function/special keys or to a
tool bar or to a menu.
We have already told you that for working in Ms-Word you should be familiar with WINDOWS. If you have
not covered WINDOWS so far then read that first and then go through MS-WORD. By now you must be
aware of the fact that a software package is improved from time to time. These improvements are sold in
the market as new versions of the same software. Thus you will find many versions of MS-WORD being used
in different offices. In this lesson we will cover the version MS-WORD 97, which is latest in the market and
contain many improvements over the older versions. However, you do not have to worry if you have an
older version such as WORD6.0 or WORD 95. All the commands available in these older versions are also
available in WORD97 and they are compatible. While working in MS-WORD you have to work with a mouse.
Also, one can work, to some extent, through the keyboard. The use of mouse is simpler as it is fully menu
driven. In MS-WORD every command is available in the form of ‘icons’.
1. Take the mouse pointer to START button on the task bar. Click the left mouse button.
2. Move the pointer to programs. You will notice another menu coming up to the right.
3. In that menu identify where Microsoft word is placed. Move the cursor horizontally to come
out of programs.
4. Move into the rectangular area meant for Microsoft word. Click the left mouse button there.
The title bar displays the name of the currently active word document. Like other WINDOWS
applications, it can be used to alter the size and location of the word window.
Word has a number of tool bars that help you perform task faster and with great ease. Two of the most
commonly tool bars are the formatting tool bar and the standard tool bar. These two
toolbars are displayed just below the title bar. At any point of time any tool bar can be made ON or OFF
through the tool bar option of View Menu.
The Ruler Bar allows you to format the vertical alignment of text in a document.
The Status Bar displays information about the currently active document. This includes the page number
that you are working, the column and line number of the cursor position and so on.
The Scroll Bar helps you scroll the content or body of document. You can do so by moving the
elevator button along the scroll bar, or by click in on the buttons with the arrow marked on them to move
up and down and left and right of a page.
(f) Workspace
The Workspace is the area in the document window where you enter/type the text of your
document.
The Word main menu is displayed at the top of the screen. The mainmenu further displays a sub menu.
Some of the options are highlighted options and some of themappear as faded options. At any time, only
highlighted options can be executed, faded options arenot applicable. Infect if the option is faded you will
not be able to choose it. You may not that any
option faded under present situation may become highlighted under different situations.
2.Graphics
You can insert special characters, symbols, pictures, illustrations, and watermarks.
or typographical
Place your cursor in the document where you want the symbol Click the Insert Tab on the Ribbon Click the
Symbol button on the Symbols Group Choose the appropriate symbol. Illustrations, Pictures, and Smart Art
To insert a picture:
Place your cursor in the document where you want the illustration/picture Click the Insert Tab on the
Ribbon
Click the Clip Art/ Picture /Smart Art Button The dialog box will open on the screen and you can search for
clip art / picture / smart art. Choose the illustration you wish to include
Click the Picture Button Browse to the picture you wish to include Click the Picture Click Insert
Resize Graphics
All graphics can be resized by clicking the image and clicking one corner of the image and dragging the
cursor to the size you want the picture
Footnotes
Footnotes are sometimes necessary for providing additional information in your document. They normally
use asuperscript number as a marker, making it easy for the reader to simply look down from the text to the
notes atthe bottom to gather further information. Word automatically keeps track of the numbering and
placement ofthe footnotes for you, making this a painless task to perform when writing that thesis, book, or
scientific paper.
Click the place in your document that you wish to place the insertion point for the reference mark to the
foot note. In the Ribbon, click the References tab. In the Footnotes section, click Insert Footnote. Word will
insert the reference mark at the point you selected and then take you to the bottom of the page. Type your
foot note. When you are done, right-click the footnote and select Go to Footnote to take you back to the
insertion point in the main body so you can continue working on your document.
Lists allow you to format and organize text with numbers, bullets, or in an outline. Bulleted lists have bullet
points, numbered lists have numbers, and outline lists combine numbers and letters depending on the
organization of the list.
New list
Place your cursor where you want the list in the document Click the Bulleted or Numbered Lists button
Begin
Nested Lists
Create your list following the directions above Click the Increase or Decrease Indent button
Formatting Lists
The bullet image and numbering format can be changed by using the Bullets or Numbering dialog box.
Select the entire list to change all the bullets or numbers, or Place the cursor on one line within the list
tochange a single bullet Right click Click the arrow next to the bulleted or numbered list and choose a bullet
ornumbering style.
Mail merge
Mail Merge consists in combining mail and letters and pre-addressed envelopes or mailing labels for mass
mailings from a form letter.
Microsoft Word can insert content from a database, spreadsheet, or table into Word documents.
This feature is usually employed in a word processing document which contains fixed text (which is the
same in each output document) and variables (which act as placeholders that are replaced by text from the
data source).
Mail Merge is a powerful tool for writing a personalized letter or E-mail to many people at the same time. It
imports data from another source such as Excel and then uses that to replace placeholders throughout the
message with the relevant information for each individual that is being messaged.
WHAT IS POWERPOINT?
PowerPoint (PPT) is a powerful, easy-to-use presentation graphics softwareprogram which allows you to
create professional-looking electronic slideshows. PPT is used to present Information in an organized
manner to anindividual or group. Using clip art, sound clips, movie clips, graphs,organization charts,
imported Web screens, and many other features, you caneasily create a presentation that will impress your
audience and convey your
USING HELP
PowerPoint Help menu offers you numerous ways to find help for a particular task. Type a subject in the
search window to see help topics.
1. In the PPT Start-up Window, click “From Design Template”located on the right-hand side of the screen
under the heading“New.”
2. Scroll down to see the various templates and click on one of them.(Slide 1, cont.) – Add title and subtitle
1. Click once on “Click to add title” (this is the title placeholder) and type How to Use PowerPoint.
2. Click once on “click to add subtitle” and type Building an Effective Presentation.
1. Click on the “New Slide” button at the toolbar located at the top of the screen.
2. Click once on the title placeholder and type What you can do with PowerPoint.
3. Click once on “Click to add text” (this is the text placeholder) andtype the following text (hit <Enter> at
the end of each line):
(NOTE: To format bullets, click on the “Format” menu and then click on“ Bullets and Numbering.”)
2. On the right side, scroll down until you see the “Text and Content Layout” options.
5. In the text placeholder, add the following text (hit <Enter> aftereach line):
• Clip Art
• Photographs
• Charts
• Graphs
• Tables
• Diagrams
• Media Clips
8. Scroll through the results and double-click on the Clip Art of yourchoice.
(Hint: Type “photograph” in the Clip Art search window to see the clip artphoto options)
3. In the text placeholder, type the following text (hit <Enter> at theend of each line):
4. Add the Clip Art of your choice to the slide(Slide 5) – Add a Chart
2. Scroll down to “Other Layouts” and click on the “Title and Chart”option (the last option).
6. Click once in your slide (outside the datasheet) to add the chart to your slide.
Adding Transitions
• Click on the “Slide Sorter View” button on the bottom, left-hand corner of your screen.
• Click the “Slide Show” menu and then click on “Slide Transition.”
• To the right, click a transition of your choice. This will apply to all the selected slides. (Note: Select
“Random Transition” – the last option – to have a variety of transitions in your slide show)
Animating Text
• All slides should still be selected (if they aren’t, click the “Edit” menu and then “Select All”).
• At the right, choose an Animation Scheme. You will see a preview with in your slide sorter view.
(Note: to apply a different Animation Scheme to each slide, you will have to select each slide individually
and then choose a scheme for each one.)
Please Note: For more advanced Animation options, you will need to utilize the “Custom Animation”
options. These are covered in the Advanced PPT class.
• Click on the “Slide Show” button on the bottom left-hand corner of the screen.
Hold down the mouse and write. Any marks you make are NOT permanent. Hit <Esc> to return to the
pointer.
ADDITIONAL EXERCISES
• Minimize the PPT program by clicking on the “minus” sign in the upper right corner.
• Go into the Web and locate the screen you’d like to use in your presentation.
• When the screen you want is displayed, hit the <Print Screen> key on your keyboard. This automatically
saves the screen to the computer’s clipboard.
• Minimize the web program (the minus button at the top right) and then maximize the PPT program (click
on the Microsoft Power Point button at the bottom of your screen).
• Click on the Paste icon on the toolbar (looks like a clipboard). The screen you saved will now appear on
your blank slide.
• Click once on the image and then drag the corners to fill the screen.
Note: You may want your slide to have a white background to better display the Web screen shot. To do
this, click the “Format” menu, click“Backg round,” and select white from the pull-down menu of colors. You
might also want to click “Omit background graphics.” Be sure to click“Apply” and NOT “Apply to All”!
You can easily add pictures to your PPT slides. To do so, you must first save the picture to the hard drive of
your computer. Then insert it into your presentation:
• In Normal View, display the slide on which you’d like the picture to appear.
• From the Insert menu, choose the Picture from File command.
• Locate the file of the picture you have previously saved and double-click the file name.
A workbook is an Excel file where the data is stored. A workbook consists of many worksheets. A worksheet
is a page in the workbook where data can be entered. The current sheet is always highlighted in the sheet
tab. Sheets belonging to a particular application can be stored in the same workbook. When the workbook
is opened, all the worksheets contained in that workbook are automatically opened. Since each workbook
contains many sheets, the user can organize various types of related information in a single file. To move
from one sheet to another sheet, click the sheet tab.
Every time the user starts Excel, it automatically loads up a blank workbook.
Select New from existing under Available Templates. In the New from Existing Workbook dialog box, browse
to the location that contains the workbook to open. After finding the required workbook, select it to create
a new workbook based on that.
2. Opening a Workbook
In the Open dialog box, browse to the location that contains the workbook to open.
Click Open.
2. Saving a Workbook
1. In the Save As dialog box, browse to the location where the workbook is to be saved.
4. Click Save.
4. SAVING A FILE IN PDF FORMAT
Files created in MS-Excel can also be saved in Portable Document Format (PDF), which is a common format
for sharing documents. PDF is a fixed-Layout electronic file format that preserves document formatting and
enables file sharing. The PDF format ensures that when the file is viewed online or printed, it retains exactly
the format that is intended, and that data in the file cannot easily be changed. The PDF format is also useful
for documents that will be reproduced by using commercial printing methods. To view a PDF file, the PDF
reader must be installed on the computer. The file saved as PDF, can not be directly changed. The changes
have to be made to the source file of Excel and saved again in the PDF format
ENTERING DATA:
There are three kinds of data the user can enter into an Excel worksheet: text (a label), a number (a value),
or a formula.
2. Type a label (text) or a value (number). A label can include uppercase and lowercase letters, numbers
and keyboard symbols.
2 ENTERING AN EDITING DATA
3 Press the ENTER key on the keyboard or click on another cell with the mouse.
Excel 2010 provides number of DATE functions that can be used to insert date to the worksheet.
2. On the Formulas Tab, in the Function Library group, click Date & Time.
To fill the same number (or text value) over and over, instead of entering the data several times, the
user can enter the data once, then select the fill handle of the selected cell and drag the mouse.
All the cells in between will be filled with the same original value. In this example, the number 1 is repeated
over several cells.
In this example, fi ll two cells with 1 and 2. Drag the fill handle down, the cells are filled with the series 1, 2,
3, 4, 5, 6.
1. Select the cell or the range that contains the data to copy.
2. Click the Copy button under the Clipboard group in the Home Tab or press Ctrl+C keys together. An
outline of the selected cells, called a marquee, shows the boundary of the selected cells.
3. Click the fi rst cell where the user wants to paste the data.
4. Click the Paste button under the Clipboard group in the Home Tab or press Ctrl+V keys together.
To move a selection rather than copy it, the user should use the Cut button or press Ctrl+X keys together
rather than the Copy button or Ctrl+C keys in step
To move a selection rather than copy it, the user should use the Cut button or press Ctrl+X keys together
rather than the Copy button or Ctrl+C keys in step 2.
1. Select the cell or the range that contains the data to move.
2. Move the mouse cursor to one of the thick black outside lines surrounding the selection. The cursor will
change from a white plus sign to a black arrow.
3. Click and hold the mouse button down and drag the selected range of data to where the user wants to
relocate it.
Release the mouse button
To copy a selection rather than moving it, the user should press the Ctrl key while doing step 3. When the
mouse button is clicked, the cursor will change from a black arrow to an arrow with a=(plus) sign.
To move or copy data to a different sheet, press Alt key (with Ctrl key if data is to be copied) while
dragging the selection to the destination sheet’s tab. Excel switches to that sheet, where the selection
3. In-cell Editing
1. Double-click the cell to edit. The insertion point appears within the cell.
2. To make corrections: Use the mouse pointer or the arrow keys, Home, and End keys to position
the insertion point where required. The Backspace and Delete keys can also be used to erase unwanted
characters.
1. Select a cell or a range of cells where the user wants to insert new cells.
2. On the Home tab, in the Cells group, click the arrow next to Insert, and then select Insert Cells. The
Insert dialog box will appear
.
3. To insert cells, select the direction in which the user wants the remaining cells to move.
4. Click OK.
1. Select a cell or a range of cells in the rows or columns where the user wants to insert new rows
or columns.
2. Select Insert Sheet Rows from Insert drop-down list of the Cells group of the Home Tab to insert rows.
3 Select Insert Sheet Columns from Insert drop-down list of the Cells group of the Home Tab
to insert columns.
1. Select the cell or range of cells, rows, or columns that the user wants to delete.
2. On the Home tab, in the Cells group, click the arrow next to Delete and then do one of the
following
Deleting cells
1. To delete cells, select the direction in which the user wants the remaining cells to move. Click OK.
3. PRESENTING A SPREADSHEET
Spreadsheets have basic data handling facilities that, allow data to be sorted, ranked and filtered
Sorting
Sorting this function allows a range of data to be sorted into ascending or descending order. For example:
When sorted by column C, the result will be:
Ranking
This function allows the rank (ie order) of an item to be displayed. For example, Cell B14 below contains the
formula =RANK(C4, C4:C11)
The formula returns the result 6, meaning that the mark of 36 Cell C5) is sixth highest in the range specified
(here C4:C11).
Filtering
Filtering: this allows you to look at only certain (filtered data). Say that in the spreadsheet shown below, you
wanted to see only results relating to Basic exams.
Turning on the filtering function for the range of cells will show drop-down lists:
If Advanced and Intermediate are unselected, leaving only Basic, then the result will be:
Charts and graphs:
Bar chart:
Line chart
Scatter graph
Pie chart
Printing spreadsheets
Margins: Sets margins around what’s printed out. Orientation: Landscape of portrait paper orientation Size:
Paper size eg A4, A3
Breaks: Specifies how the spreadsheet is to be split up for printing on different pages
Print titles: Specifies rows and columns to repeat on each printed page.
UNIT-IV
Introduction to C Language
C is a programming language developed at AT & T’s Bell Laboratories of USAin 1972. It was designed
and written by a man named Dennis Ritchie. In the lateseventies C began to replace the more
familiar languages of that time like PL/I,ALGOL, etc
ANSI C standard emerged in the early 1980s, this book was split into twotitles: The original was still
called Programming in C, and the title that coveredANSI C was called Programming in ANSI C. This
was done because it tookseveral years for the compiler vendors to release their ANSI C compilers
and forthem to become ubiquitous. It was initially designed for programming UNIXoperating system.
Now the software tool as well as the C compiler is written in C.Major parts of popular operating
systems like Windows, UNIX, Linux is stillwritten in C. This is because even today when it comes to
performance (speed ofexecution) nothing beats C. Moreover, if one is to extend the operating
system towork with new devices one needs to write device driver programs. Theseprograms are
exclusively written in C. C seems so popular is because it is reliable, simple and easy to use. often
heard today is – “C has been already supercededby languages like C++, C# and Java.
1 ) Comment line
2) Preprocessor directive
4) main function( )
Local variables;
Statements;
Comment line
/*……………………………..*/
Comment line is used for increasing the readability of the program. It is useful inexplaining the
program and generally used for documentation. It is enclosed withinthe decimetres. Comment line
27
can be single or multiple line but should not benested. It can be anywhere in the program except
inside string constant & characterconstant.
Preprocessor Directive:
#include<stdio.h> tells the compiler to include information about the standardinput/output library.
It is also used in symbolic constant such as #define PI3.14(value). The stdio.h (standard input output
header file) contains definition&declaration of system defined function such as printf( ), scanf( ),
pow( ) etc.Generally printf() function used to display and scanf() function used to read value.
Global Declaration:
This is the section where variable are declared globally so that it can be access byall the functions
used in the program. And it is generally declared outside thefunction :main()It is the user defined
function and every function has one main() function fromwhere actually program is started and it is
encloses within the pair of curly braces.
The main( ) function can be anywhere in the program but in general practice it isplaced in the first
position.
Syntax :
main()
……..
……..
……..
int main( )
return 0
The main function does not return any value when void (means null/empty) as
28
Output: C language
The program execution start with opening braces and end with closing brace.And in between the
two braces declaration part as well as executable part ismentioned. And at the end of each line, the
semi-colon is given which indicatesstatement termination.
#include <stdio.h>
return 0;
The alphabets, numbers and special symbols when properly combined formconstants,
2.Keyword: There are certain words reserved for doing specific task, these wordsare known as
reserved word or keywords. These words are predefined and alwayswritten in lower case or mall
letter. These keywords cann’t be used as a variablename as it assigned with fixed aning. Some
examples are int, short, signed,unsigned, default, volatile, float, long, double, break, ontinue,
typedef, static,do, for, union, return, while, do, extern, register, enum, case, goto,
struct,char,auto,constetc.
Data types: Data types refer to an extensive system used for declaring variables or functions
ofdifferent types before its use. The type of a variable determines how much space itoccupies in
storage and how the bit pattern stored is interpreted. The value of avariable can be changed
anytime.
A variable declared to be of type int can be used to contain integral valuesonly—that is, values that
do not contain decimal places. A variable declared to beof type float can be used for storing floating-
29
point numbers (values containingdecimal places). The double type is the same as type float, only
with roughly twicethe precision. The char data type can be used to store a single character, such as
theletter a, the digit character 6, or a semicolon similarly A variable declared char canonly store
character type value.
When the qualifier unsigned is used the number is always positive, and whensigned is used number
may be positive or negative. If the sign qualifier is notmentioned, then by default sign qualifier is
assumed. The range of values forsigned data types is less than that of unsigned data type. Because in
signed type,the left most bit is used to represent sign, while in unsigned type this bit is alsoused to
represent the value.
3.Control Statement
Generally C program statement is executed in a order in which they appearin the program. But
sometimes we use decision making condition for executiononly a part of program, that is called
control statement. Control statement definedhow the control is transferred from one part to the
other part of the program. Thereare several control statement like if...else, switch, while, do....while,
for loop,break, continue, goto etc.
Loops in C
Loop:-it is a block of statement that performs set of instructions. In loopsRepeating articular portion
of the program either a specified number of time oruntil a particular no of condition is being
satisfied.
There are three types of loops in c
1.While loop
2.do while loop
3.for loop
While loop
Syntax:-
while(condition)
{
Statement 1;
Statement 2;
}
Or while(test condition)
Statement;
The test condition may be any expression .when we want to do something a fixedno of times but not
known about the number of iteration, in a program then whileloop is used.Here first condition is
30
checked if, it is true body of the loop is executed else, Ifcondition is false control will be come out of
loop.
Example:-
/* wap to print 5 times welcome to C” */
#include<stdio.h>
void main()
{
int p=1;
While(p<=5)
{
printf(“Welcome to C\n”);
P=p+1;
}
}
Output: Welcome to C
Welcome to C
Welcome to C
Welcome to C
Welcome to C
So as long as condition remains true statements within the body of while loop will
do while loop
This (do while loop) statement is also used for looping. The body of this loop may
contain single statement or block of statement. The syntax for writing this
statement is:
Syntax:-
Do
Statement;
while(condition);
Example:-
#include<stdio.h>
void main()
31
int X=4;
do
Printf(“%d”,X);
X=X+1;
}whie(X<=10);
Printf(“ ”);
Output: 4 5 6 7 8 9 10
Here firstly statement inside body is executed then condition is checked. If thecondition is true again
body of loop is executed and this process continue until thecondition becomes false. Unlike while
loop semicolon is placed at the end ofwhile.There is minor difference between while and do while
loop, while loop test thecondition before executing any of the statement of loop. Whereas do while
looptest condition after having executed the statement at least one within the loop.If initial
condition is false while loop would not executed it’s statement on otherhand do while loop executed
it’s statement at least once even If condition fails forfirst time. It means do while loop always
executes at least once.
Notes:
Do while loop used rarely when we want to execute a loop at least once.
for loop
In a program, for loop is generally used when number of iteration are known inadvance. The body of
the loop can be single statement or multiple statements. Its
Syntax:-
36 *Under revision
for(exp1;exp2;exp3)
Statement;
Or
32
{
Statement;
Here exp1 is an initialization expression, exp2 is test expression or condition andexp3 is an update
expression. Expression 1 is executed only once when loopstarted and used to nitialize the loop
variables. Condition expression generallyuses relational and logical operators. And updation part
executed only when afterbody of the loop is executed.
Example:-
void main()
int i;
for(i=1;i<10;i++)
Printf(“ %d ”, i);
Output:-1 2 3 4 5 6 7 8 9
Nesting of loop
When a loop written inside the body of another loop then, it is known as nesting ofloop. Any type of
loop can be nested in any type such as while, do while, for. Forexample nesting of for loop can be
represented as :
void main()
int i,j;
for(i=0;i<2;i++)
for(j=0;j<5; j++)
Output: i=0
33
j=0 1 2 3 4
i=1
j=0 1 2 3 4
38 *Under revision
Break statement(break)
Sometimes it becomes necessary to come out of the loop even before loopcondition becomes false
then break statement is used. Break statement is usedinside loop and switch statements. It causes
immediate exit from that loop in whichit appears and it is generally written with condition. It is
written with the keywordas break. When break statement is encountered loop is terminated and
control istransferred to the statement, immediately after loop or situation where we want tojump
out of the loop instantly without waiting to get back to conditional state.
When break is encountered inside any loop, control automatically passes to thefirst statement after
the loop. This break statement is usually associated with ifstatement.
Example :
void main()
int j=0;
for(;j<6;j++)
if(j==4)
break;
Output:
0123
Continue statement is used for continuing next iteration of loop after skippingsome statement of
loop. When it encountered control automatically passesthrough the beginning of the loop. It is
usually associated with the if statement. It isuseful when we want to continue the program without
executing any part of theprogram.
The difference between break and continue is, when the break encountered loop isterminated and it
transfer to the next statement and when continue is encountercontrol come back to the beginning
position.
34
In while and do while loop after continue statement control transfer to the testcondition and then
loop continue where as in, for loop after continue controltransferred to the updating expression and
condition is tested.
Example:-
void main()
int n;
if(n==4)
continue;
printf(“%d”, n);
Printf(“out of loop”);
35
Example:-
/* To check a number is eve or odd */
void main()
{
int n;
printf (“enter a number:”);
sacnf (“%d”, &n);
If (n%2==0)
printf (“even number”);
else
printf(“odd number”);
}
Output: enter a number:121
odd number
Nesting of if …else
When there are another if else statement in if-block or else-block, then it is callednesting of if-else
statement.
Syntax is :-
if (condition)
{
If (condition)
Statement1;
else
statement2;
}
Statement3;
If….else LADDER
In this type of nesting there is an if else statement in every else part except the lastpart. If condition
is false control pass to block where condition is again checkedwith its if statement.
Syntax is :-
if (condition)
Statement1;
else if (condition)
statement2;
else if (condition)
statement3;
else
statement4;
This process continue until there is no if statement in the last block. if one of thecondition is satisfy
the condition other nested “else if” would not executed.
But it has disadvantage over if else statement that, in if else statement wheneverthe condition is
true, other condition are not checked. While in this case, allcondition are checked
36
UNIT-V
1. Hacking
Hacking is the unauthorized use of computer access. In hacking activity the hackers generally –-
Access or steal confidential data from a website or some profile
-Plant virus programs which can help to access the computer by intruders.
2. Cyber theft
This fraudulent activity by un authorized access of network and alternation of a database and
stealing money from it.
-Moonlighting
Software Piracy
Every software is protected by individual copyright and user license that protects software to be
made for a limited number of times. So, software piracy means unauthorized copying of software.
Privacy Issues:
Information technology has enabled us to find and share relevant information through online mode.
On the other hand, it has also exploited the value of privacy. There are so many ways privacy is
exploited. Some examples are:
37
(1) By using internet webcams, proficient computer users can use any webcam of any computer
online, and it will have access to people’s private life. Many celebrities have become victims of these
online scams.
(2) Although the main concept of this networking is to connect with friends and relatives and to
share life with them, however, the flaw in this is that using your private profile anyone can share
your confidential information like photos, or can send fake friend requests to unknown people. This
might expose one to users with wrong intentions. Also some companies use social media for spying
on their employees. Cybercrime has increased these days through social media which is alarming for
the society.
Copyright issue:
Using information technology it is now easy for users to access any information or artifact at any
given point of time. With the enhanced development of music sharing networks and photo
bookmarking sites, the original creators of these artifacts are losing the credibility of their work,
because IT users of can easily get access and share that data with friends. Availability of free music
and different file downloading sites are increasing on the internet every day.
Besides, users can freely download music albums, files, books, etc. In this scenario, one genuine user
will purchase the item by onetime payment, and they will submit it to a free download site. From
these sites, other users can simply download that data freely. It is profitable and useful news for the
users as it saves their money, but it is copyright infringement for the original creator of the work.
Though Government has closed some of these sites, but many are still there and running
successfully.
As the information technology service is committed to providing the service 24hrs a day, so there is
immense pressure on the IT people. Most of the IT giants need a standby IT team to operate for 24
hours. Overwork and an increased amount of stress create imperfection among the employees.
Security
With the advancement of the internet, it has become very easy for hackers to hack into any
computer or related system as long when it is connected on the internet. Using an IP address
hackers can easily access a user’s computer and use data for unethical reasons. Also, the wide usage
of internet cookies which is used to collect information whenever we use the internet has given IT
users to high risks of fraudulent activities and conflicting interests.
These cookies are used by big companies to determine the products or services they can use for
advertisement. A hacker can easily interrupt online banking operation in between the transaction,
and the whole transacted amount can be transferred to hackers’ account. This can have severe
implication to both the bank as well as their customers. This is a misuse of technology.
Digital divide
Information technology has immense opportunities, and it has reformed many industries in
developed and developing countries. But developing countries have difficulties taking the same
38
benefits of Information technology. To get proper benefits, they need to train their human resources
and end users. They should also have to adopt the new culture which is a bit costly comparing the
economic conditions of the society of these developing countries.
Also,there are remote areas in these countries where they do not even have power, so information
technology tools like computers cannot be used. In other sectors like education, most of these
developing countries have poor old education systems, so a student will not be aware of new
information technologies.
Prevention is better than cure. It is expected that preventive measures should be taken care of
before the event of any security incident. However, the reality is, it is not possible to prevent all such
incidents. But with proper precautions, at least minimization of the impact can be possible. There
are few points to be taken care while establishing a security measure in an organization:
1. All the policies related to security and procedures need to be developed and must be clearly
stated to the employees. Because it is seen that many incidents happen due to the mistakes of IT
people who are responsible for configuring security devices like firewalls, authentication systems,
etc. They might not follow the proper procedures as guided by the management. So the security
policies with procedures must be thoroughly checked to confirm that they have clarity and provide
the appropriate level of security for the organization.
3. Routine assessment is needed to find out vulnerabilities in the environment. These assessments
must be performed by security personnel with expertise in that field. He must have appropriate
permission to perform the actions which may include bonds as well.
4. Routine check-up to all computers along with network devices is necessary to confirm that these
devices have all of the latest security patches installed in it.
5. Arranging training programs related to the safety for IT people and end users is necessary to make
them aware of the latest scenarios. Because it is extremely vulnerable if the end users are not
experienced and efficient.
6. Security banners can play a significant role to take preventive measures. Because it can remind a
user about their responsibilities and limitations.It also warns people about the possible prosecution
in the case of any violation. Proper legal advice is necessary before posting such banners.
9. Checking all log files including operating system logs, application logs, etc. are needed. Scrutinizing
logging mechanism and performance is also necessary.
39
10. Maintaining a backup system is needed, besides that verifying those backup and restore
procedures along with access rights should regularly be monitored.
11. Assigning a Computer Security Incident Response Team (CSIRT) to deal with security incidents is
necessary for every organization.
The CSIRT(Computer Security Incident Response Team) is the key team who deals with computer
security incidents of an organization. This team of people is consists of individuals who are
responsible for dealing with all security incidents. The duties of team members should be defined
precisely so that no area of response remains uncovered.
This CSIRT team assembling is critical to an organization, and this can influence positively how
incidents are handled in any situation. The responsibilities of a CSIRT team are:
4. Promoting security consciousness within the company to prevent incidents from occurring in an
organization.
5. Auditing support system and network system using processes like risk assessment and penetration
testing.
8. Analyzing and development of new technologies to minimize security threats and risks.
When a CSIRT team is created, an organization needs to prepare the team in a way so that they are
capable and equipped to handle incidents.
India witnesses many cybercrimes annually, with over 44,000 reported cases. Among the states in
India, Karnataka emerges as the leader in terms of cybercrime rates. According to a 2022 report by
Statista, the average cost of data breaches was USD 2 million in India. This financial impact reflects
the consequences of data breach incidents. For more detailed statistical information, please refer
here.
40
Cyber law in India is governed by two key legislations: the Indian Penal Code and the Information
Technology Act of 2000. These legal frameworks provide the necessary guidelines and provisions to
address cybercrime and protect digital assets and individuals’ rights in cyberspace.
A variety of cybercrimes are addressed by Indian cyber laws, covering two main aspects: hacking
systems and employing them to commit crimes of different magnitudes. Additionally, Indian cyber
law encompasses a comprehensive range of domains, such as intellectual property rights and privacy
rights, among others.
Cyber law in India encompasses a broad range of subjects, although it is important to note that the
list provided is not exhaustive. Similar concepts may also be addressed in other jurisdictions globally.
The following outlines the various types of cybercrimes and the corresponding cyber law
protections.
Fraud
Cyber law in India identifies the theft of identities, credit cards, and other finance-based crimes as
fraud; these cybercrime offenses may lead to fines, imprisonment, or both.
Copyright
Cyber law in India protects copyrighted works present in online forums. The accused are punished
based on the Copyright Act and other applicable acts, rules, and regulations.
Defamation
The Indian constitution ensures the right to speech, but it comes with limitations; when the
limitations are crossed, it constitutes defamation. A person who defames another person or an
organization will be punished under cyber law.
But, What constitutes defamation activity online? In brief, according to cyber law, spreading false
information or information without evidence online constitutes defamation activity.
41
Indeed, with the growth of social media usage, stronger cyber law protection is required against
defamation.
Cyber law in India protects online users from harassment and stalking. When someone speaks in a
targeted way against you online, it would constitute harassment. The factors of harassment are
circumstantial.
Harassment and stalking are serious offenses in India that have repercussions in both civil law and
criminal law.
Trade secrets
In general, trade secrets are confidential information about companies. Attempting to leak
confidential information to the public or using the same for monetary gain is a serious offense, as
per Indian cyber law. The penalty for leaking or using trade secrets is determined by the gravity of
the injury experienced by the infringing party.
But, why exactly is cyber law in action against cybercrimes? What are its objectives? The following
section will answer the same.
42
There are several types of cyber laws, each addressing specific aspects of digital activities and cyber
security. Here are some common categories of cyber laws:
1. Privacy Laws:
o Privacy laws govern the collection, use, and protection of individuals’ personal
information online.
o Examples include the General Data Protection Regulation (GDPR) in Europe and the
California Consumer Privacy Act (CCPA) in the United States.
2. Cybercrime Laws:
o These laws define offenses, penalties, and procedures for investigation and
prosecution.
o Data breach notification laws mandate that organizations inform affected individuals
and authorities when a data breach occurs.
o These laws aim to ensure transparency and help individuals take necessary actions
to protect themselves.
o These laws often set standards and requirements for data security practices.
o Laws related to e-commerce and online contracts establish legal frameworks for
online transactions, electronic signatures, and consumer rights.
o Regulations governing social media and online content address issues such as hate
speech, defamation, and harmful content.
43
o They set guidelines for the removal or restriction of such content.
o Computer crime laws specifically target offenses involving computer systems and
networks.
These are just a few examples of the types of cyber laws that exist to govern and regulate various
aspects of digital activities, protect individuals’ rights, and ensure cyber security in the digital age.
The specific laws and regulations can vary significantly from one jurisdiction to another.
Lawmakers have executed cyber law legal protections with the following objectives: The following
features of cyber law make the internet a much safer place to explore:
• To prevent debit card or credit card fraud. Many people have switched to digital payment
methods. Cyber law tries to make sure that victims do not have to go through the additional
agony of long procedures.
• To block transactions when there is any unusual activity such as the input of an incorrect
password.
• To ensure the safety of protected data. By knowing what cyber law is, one can easily adopt
preventative measures.
44
• Better protection of e-commerce sites ensures better revenue for the companies; this, in
turn, ensures a better economy for the country.
• Grievances for online transactions will be heard by the court as a part of the remedial
measures of cyber law.
• Recognition of e-documents and grievances on the same will be heard by the court.
• Fixing security issues by the companies leads to better data protection standards.
The above-mentioned are a few of the popular aspects of cyber law in India. This is not legal advice.
If you require cyber law remedies, contact a lawyer immediately.
• Try to maintain a few social media accounts as possible. Every information you put online is
a potential way to hack your account. If you are serious about maintaining your presence on
several social media platforms, always ensure that your passwords are strong. Regular
changing of passwords is a great way of protecting your data from hackers. You can use
password manager apps to create strong passwords. Two-factor authentication would add
an additional layer of security for sure.
• Always question the app’s access permission. When you download any app/ visit any
website, you will be requested a particular number of permissions. If basic permissions are
requested, it is fine. However, if permissions are requested to access sensitive information
such as your gallery and such, immediately deny such requests. More so, quit the website
immediately/ delete the app immediately.
• Free wi-fi is always intriguing. But oftentimes it is a honey trap laid by hackers to lure you
into using it. When you access the internet via free wi fi hackers can easily get into your
device, spread viruses, steal information, and more of a similar sort.
• Finally, always be suspicious of any “too good to be true” kind of messages/ calls. If you get
any such calls/ messages, always report to the respective officials immediately.
45