Professional Documents
Culture Documents
p
+
Microsoft Office 2000 is a software suite that consists of different applications that
complete different activities. MS Office 2000 is by far the most widely recognized
software suite in the world.
p à - Microsoft Word 2000 provides powerful tools for creating and
sharing professional word processing documents.
p
à - With Microsoft Excel 2000, you can create detailed spreadsheets for
viewing and collaboration. Create customized formulas for your data and analyze it with
the easy to construct charts.
p à - Microsoft PowerPoint 2000 provides a complete set of tools for
creating powerful presentations. Organize and format your material easily, illustrate your
points with your own images or clip art, and even broadcast your presentations over the
web.
p à - Microsoft Access 2000 gives you powerful new tools for managing
your databases. Share your database with co-workers over a network, search and retrieve
information quickly, and take advantage of automated, pre-packaged wizards and
solutions to quickly create databases.
p
à - Microsoft Publisher 2000 helps you easily create, customize, and
publish materials such as newsletters, brochures, flyers, catalogs, and Web sites. Publish
easily on your desktop printer
Word Processor is a Software package that enables you to create, edit, print and save
documents for future retrieval and reference. Creating a document involves typing by
using a keyboard and saving it. Editing a document involves correcting the spelling
mistakes, if any, deleting or moving words sentences or paragraphs.
m WordStar
m Word perfect
m Microsoft word
p
MS-WORD is a part of the MS OFFICE. It not only supports word processing features
but also DTP features. Some of the important features of Ms-Word are listed belowà
m "sing Word, a document could be created and edited later, as and when required,
by adding more text, modifying the existing text, deleting/moving some part of it.
m Changing the size of the margins can reformat complete document or part of text.
m Font size and type of fonts can also be changed. Page numbers and Header and
Footer can be included.
m Spelling can be checked and correction can be made automatically in the entire
document. Word count and other statistics can be generated.
m Text can be formatted in columnar style as we see in the newspaper. Text boxes
can be made.
m Tables can be made and included in the text.
m Word also allows the user to mix the graphical pictures with the text. Graphical
pictures can either be created in word itself or can be imported from outside like
from Clip Art Gallery.
m Word also provides the mail-merge facility.
m 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.
m It also provides online help of any option.
p
1. Take the mouse pointer to START button on the task bar. Click the left mouse
button. The monitor will show like as followsà
Ô Move the pointer to ã !". You will notice another menu coming up to the
right.
3. In that menu identify where p is placed. Move the cursor
horizontally to come out of ã !".
4. Move into the rectangular area meant for p #Click the left mouse
button there. The computer will start MS-WORD. You will find the screen as
follows.
!! "$
"sing the mouse click on the %
menu. Select and select
!& ". A new
Blank document appears on the screen.
From the %
menu, select ã option. In the Look In box, Click the drive that contains
the document, in the list of files, click the document name.
Start MS-WORD program. Open a new document and enter any two paragraphs of text.
i. Margin Setting
m On the %
menu, select ! ã, and then select the p! tab.
m In the left box enter the value as 1"
m In the right box enter the value as 0.75"
ii. Center the heading and make it bold. Increase the font size
Select (block) the heading line; click the button in %"! tool bar.
Select 3
button from the %"! tool bar (or from the Format menu, select
% option and then select Font Style as 3
). To increase the font size, from
the %"! menu select % option and then select sizes from - pop down
menu and press OK.
iii. "nderline the specified words in the document and change them to italics
Select the specified word and click the .
button. If you click the same
button again, the underline is removed. To make the word italics from the
%"! menu, select %) then change the % /
to !
(or select +
button from the %"! tool bar).
iv. Conduct spell check and correct them suitably
Place the curser in the beginning of the file. From the
menu, select
Spelling! !""!. It checks the spelling and displays ! à box to
replace the word that word could not be found in the open dictionaries. Accept
the word in Change Toà box type the correct word or select word in the
box or select box.
Select the items to which you want to add bullets or numbers. On the %"!
toolbar, to add, click the Bullets button or to add numbering, click the
Numbering button. Otherwise from the %"! menu, select the 3
!
" option and select appropriate.
m From the 4 menu, choose
!, from that click on !
option and observe that a drawing menu appears at the bottom of the
document.
m To draw a !
click on the icon and drag the mouse on the
document space to get the required size of rectangle.
m To draw a
or '!
click on the icon and drag the mouse on
the document space to get the required size of Circle/Oval.
m To draw a ( click on the icon and drag the mouse on the
document space to get line of required length.
m To draw an click on the icon and drag the mouse on the
document space to get an arrow of required length.
m When we move the mouse cursor on the icons of the drawing menu, we
get information about the respective icons, using it
m We can insert Text box, Clip Art or Word Art by clicking on the
3)
ã!) ! icons respectively.
m We can change the color of the font, line or background color by
clicking on %
)(
and %
respectively, and then
choosing the desired color.
m We can change the Style of line, dash & arrow by clicking on (
/
)!/
and /
respectively and choosing the desired
style from the given choice.
m We can insert Different types of Lines, Basic shapes, Block arrows,
Flow chart Symbols, Stars and Banners, Call outs by clicking on
!ã, and selecting the required option.
m We can give 3D and shadow effects for the shapes by clicking 1 and
! icons respectively.
x. Including logo/emblem/symbol
m From menu choose /"
option from it select the required
symbol and click on insert button.
m From menu choose Picture then select the
ã ! or "
option and insert the desired logo or emblem present in them.
0# !!"!
! !
ã ã!&! )
&
p )ã
!!ã! ã"&)
!'
"! #
Details of the book No.of
Sl.No Title of the Author Edition Publication Copies
book
$
m Create a new document. Type the required matter for the letter.
m To insert a table, from the !
menu, select option, click on !
)we
get a window for table. Enter the value of "
" field as 6, and
desired value in "field.
m Enter the table headings in the first row and make it and 3
#
m Fill the table with some data (for example) as given below.
m To sort on any one column, select the column. Then from !
Menu, select the
Option. The default order is ascending order and if required change the order
to descending. And then press OK.
#
! #
# 3& ã
1. Computer Basse and Allen 2000 Addison 25
Algorithms, Wan Gelder Wesley
Introduction to
Design and
Analysis
2. Data Structures, Sartaj Sahni 1998 McGraw-Hill 10
Algorithms, and
Applications in
C++,
!
""! ! ã
DOS (an acronym for Disk Operation System) is a tool which allows you to control the
operation of the IBM PC.
To work on DOS first click on !button then select ã !" then choose
! and then click on ""! "ã.
67! /""!
We can move from directory to directory using the CD command (change directory)
Exampleà
m C> cd furniture
m C> cd \furniture\cd..
8""!
The COPY command can be used both to copy files from disk to disk or to create a
second copy of a file on a single disk.
Exampleà
Copies the file 'word1.doc' from the C drive to the A drive and gives it the
same name.
6 /7""!
The DIRECTORY command lists the names and sizes of all files located on a particular
disk.
Exampleà
m C> dir
m Shows directory of drive C
m C> dir /w
m Shows directory in wide format, as opposed to a vertical listing.
ã
Exampleà
Lists all files on the B drive with a filename starting from the word 'ccp'.
m The asterisk is a wild-card character which allows the user to enter only a
limited part of a file specification to find a file. It is useful when you wish to
locate a group of files with the same filename or the same extension.
m On other occasions you may have forgotten part of a file specification. You
can use '*' in place of the parts of the specification you have forgotten.
m Similarly, '?' permits wild-card searches keyed to single characters.
Exampleà
Lists all five-letter files with the first four letters 'LABE' and an extension of
'COM'.
%p""!
To format new disks. The format command checks a diskette for flaws and creates a
Y where all the names of the diskette's files will be stored.
Exampleà
m C> format aà
p96p7p!& /""!
Exampleà
p
6
7""!
The RENAME command permits users to change the name of a file without making a
copy of it.
Exampleà
Exampleà
m C> rd mine
8%(
The file will have exactly the same contents as the file .
(
(
help
and DOS will provide a complete list of command names. If you don't remember the
syntax for the command, type a followed by the command nameà
help command_name
Exampleà
help date
3%(
Batch files are not programs, they are list of command line instructions that are V Y
together in one file.
3. !! !!
(#3 ã'
ã!
/
""! : !) "#
!"$
Help date
Help time
$
1) Open Command prompt type Dà\> edit <filename>.bat
2) Type the program in Edit Window.
3) save file name by selecting ALT+F -> Save
ã$
Dà\>HELPDOS
Type DATE without parameters to display the current date setting and a prompt for a
new one. Press ENTER to keep the same date.
If Command Extensions are enabled the DATE command supports the /T switch which
tells the command to just output the current date, without prompting for a new date.
Displays or sets the system time.
Type TIME with no parameters to display the current time setting and a prompt for a new
one. Press ENTER to keep the same time.
If Command Extensions are enabled the TIME command supports the /T switch which
tells the command to just output the current time, without prompting for a new time.
6 ! ! ! !
p8p4
#3 0 ã!!")
!! /6 '/ã!!"g7! "'
6 '
/ã!!"07" /
/! /#
!"$
Directory of Dà\msrit
"$
Step 1à Begin
Step 2à [Read the values for the coefficients a, b and c]
Read a,b,c
Step 3à IF a is equal to 0 or b is equal to 0 or c is equal to 0
THEN Write ³Invalid inputs´, go to Step 15
Step 4à [Compute] disc B b2 ± 4 * a * c
Step 5à IF disc is less than 0 go to Step 6
ELSE go to Step 10
Step 6à Write ³Complex roots´
GV
Step 7à [Compute the real part,] real B
2
Is (a == 0)
disc B b * b - 4 * a * c Write
³Invalid Inputs´
m a
Is disc<0
Write
real µ+i¶ imag
and real-i imag Is disc>0
GV
root1 B
| disc | 2*
root1 B- b+
2* root2 B root1
| disc |
root1 B- b -
2*
Write
root1 and root2
Write
root1 and root2
a
Stop
!"$
#include <stdio.h>
#include <math.h>
void main( )
{
float a, b, c;
float disc, root1, root2;
float real, imag;
{
disc = b * b - 4 * a * c;
if(disc < 0 ) { /* Caseà imaginary roots */
printf("\n\n Roots are Imaginary...");
real = -b / (2 * a);
imag = sqrt(fabs(disc)) / (2 * a);
printf("\n\n Complex Root1 = %7.4f +i %7.4f",real, imag);
printf("\n Complex Root2 = %7.4f -i %7.4f",real, imag);
}
else if( disc = = 0 ) { /* Caseà real and identical roots */
printf("\n\n Roots are Real & Identical...");
root1 = -b / (2 * a);
root2 = root1;
printf("\n\n Root1 = %7.4f",root1);
printf("\n Root2 = %7.4f",root2);
}
else { /* Caseà real and distinct roots */
printf("\n\n Roots are Real & Distinct...");
root1 = (-b + sqrt(disc)) / (2 * a);
root2 = (-b - sqrt(disc)) / (2 * a);
printf("\n\n Root1 = %7.4f",root1);
printf("\n Root2 = %7.4f",root2);
}
}
} /* End of main( ) */
ã$
1) Enter the Coefficients of the Equation à ax2+bx+c=0 ? à
000
Errorà Coefficients value must be Non-Zero...
%
!$
Start
µ*¶ for
;#@>?
#
;#=>? #
;#=G?
;#@A?
#
;#@A?
;#@2?
#
;#@2?
result B a + b result B a G b result B a * b Write ³Invalid
Operation code´
%!
b b .EQ. 0
a
Write result
result B a / b
a
Stop b
Write
³Division by
ZERO error´
a
/* To simulate a simple calculator that performs arithmetic operations */
#include <stdio.h>
void main( )
{
int a, b;
char opcode;
clrscr( );
printf("\n Enter any two Integers ? à ");
scanf("%d%d",&a, &b);
switch(opcode) {
} /* End of main( ) */
ã$
Enter any two Integers ? à 8
2
Result = 10
Result = -1
Result = 30
Result = 7
+# !ã !" !! ã @?% !
"#6.
ã 7#
"
Step 1à Begin
Step 2à [Read the value of n]
Input n.
Step 3à [Initialize] fib1B 0 and fib2B 1
Step 4à IF n = = 0 THEN Write ³Errorà Input non-zero positive number´.
ELSE IF n = = 1 THEN Write the value of fib1.
Step 5à ELSE
[Generate Fibonacci Numbers]
Write the value of fib1, fib2.
Repeat Step 6 for i =3 to i = n
fibBfib1+fib2.
Write the value of fib.
fib1Bfib2.
Fib2Bfib.
Step 6à End.
%
!$ Start
fib1 B 0
fib2 B 1
Is n.= 0
Print ³Input
Non-Zero
Is n=1 Print fib1
Positive Number
Only´
Print fib1, fib2
a
i=3
b i <= n
a
i+1
Stop
Write fib
fib1 B fib2
b fib2 B fib
!"$
#include <stdio.h>
void main( )
{
long int n, i, fib1 = 0, fib2 = 1, fib;
if(n = = 0)
printf("\n Errorà Input non-zero Positive Number...");
else if(n = = 1) {
printf("\n The Generated Fibonacci Number isà \n");
printf("\n %ld",fib1);
}
else {
printf("\n The Generated Fibonacci Numbers areà \n");
printf("\n %ld\t%ld",fib1, fib2);
} /* End of main( ) */
ã$
1) Enter the value for N ? à 0
Errorà Input non-zero Positive Number...
2) Enter the value for N ? à 1
The Generated Fibonacci Number isà 0
3) Enter the value for N ? à 10
The Generated Fibonacci Numbers areà
0 1 1 2 3 5 8 13 21 34
# !ã !" ! (p !
ã
!
' #.
?
!
"#6.
ã 7
"$
Step 1à Begin
Step 2à [Input value of numbers]
Read a,b
Step 3à [Duplicate values of a and b]
ma nb
Step 4à[use Euclid¶s algorithm]
Repeat step 4 while(n !=0)
remm mod n
mn
nrem
End while
Step 5à [Compute L.C.M and print result]
Lcm (a*b)/m
Print¶G.C.D¶=m,¶L.C.M¶=lcm
Step 6à End
Start
Read any two Integer
numbers m & n
pBm
qBn
Is n!=0
rem=m%n
m=n
n=rem
GCD B m
LCM B (p * q) / GCD
Stop
!"$
#include <stdio.h>
void main( )
{
int m, n, rem, GCD, LCM, p, q;
clrscr( );
while((q != 0) {
rem=p%q;
p=q;
q = rem;
}
GCD = p;
LCM = (m * n) / GCD;
printf("\n\n The GCD and LCM for Integers %d and %d are à %d &
%d",m, n, GCD, LCM);
} /* End of main( ) */
ã$
Step 1à Begin
Step 2à [Read the value of n]
Read n.
Step 3à [Initialize the value ] revB0,sumB0.
Step 4à IF n >= 0 tempBn
do
digitBn mod 10
revBrev*10+digit.
n=n/10.
While(n!=0)
Step 5à IF(rev= =temp)
THEN Write ³The Number is Palindrome´.
ELSE
Write ³The Number is not a Palindrome´.
Step 6à End.
%
!$
Start
Write ³Input
Positive
Is n = 0
Number Only´
a rev B 0
sum B 0
temp B n
digit B n %10
rev B rev * 10 + digit
n B n / 10
Is n =0
Write rev
Write ³Number
Is rev .= temp
³, temp, ³is not a
Palindrome´
Write ³Number
³, temp, ³is a
Palindrome´
a Start
!"$
/* To reverse a given integer number and check whether it is a palindrome or not */
#include <stdio.h>
void main( )
{
int n, temp, digit, rev = 0, sum = 0;
clrscr( );
printf("\n Enter the Number ? à ");
scanf("%d",&n);
if( n >999&&n<10000)
{ temp = n;
do {
digit = n % 10;
rev = rev * 10 + digit;
sum += digit;
n /= 10;
} while (n != 0);
if (rev = = temp)
} /* End of main( ) */
ã$
1) Enter the Number ? à 1234321
The Reversed Number of 1234321 Isà 1234321
The Number 123421 is Palindrome...",
2) Enter the Number ? à1234
The Reversed Number of 123 Isà 4321
The Number 1234 is not a Palindrome...",
10. !ã !" ! '" ã "#
ã '" !
"! #6.
ã 7
"$
Step 1àBegin
Step 2à[Input the number]
Read n
Step 3à [Initialize flag]
Flag 1
Step 4à [check for division of n]
Repeat step 4 for i2 to n/2
If n%i=0
Flag0
Goto step5
End if
Step 5à [output the result]
If flag=1
Print´prime number´
Else
Print´not a prime number´
Step 6à end
%
!
Start
Read number n
n .GT. 0
Write ³Input
non-zero flag B 1
Positive
Number Only´
i=2
i <= n/2
i+1
b
rem B n%i
Is rem .=. 0
flag B 0
Write n ³is a prime number´ b
!"$
b
Stop
/* To find whether a given number is a prime or not and output suitable message
*/
#include <stdio.h>
void main( )
{
int n, i, flag;
clrscr( );
if(n == 0)
printf(³enter non zero value´);
else if(n==1)
printf(³\n neither prime nor composite´);
else
{
flag=1;
for (i = 2; i <= n / 2; i++)
if (n % i = = 0) {
flag = 0;
break;
}
if (flag)
printf("\n\n %d Is a Prime Number.. ",n);
else
printf("\n\n %d Is Not a Prime Number.. ",n);
}
} /* End of main( ) */
ã$
1) Enter Any Number To Check for a Prime Number ? à 4
4 Is Not a Prime Number..
2) Enter Any Number To Check for a Prime Number ? à 17
17 Is a Prime Number.
:3
gg# !ã !" ã!
" ! !
" !!/# ! !/!! '&/ "
! ã!
"! !
"! .
"
Step 1à Begin
Step 2à [Read the value for number of elements in n]
Read n.
Step 3à Repeat Step 3 for iB0 to n
Read a[i]
Step 4à Read the value of keyno.
Step 5à [Initialize the value ]
lowB0.
highBn-1.
flagB0.
Step 6à Repeat Step 6 While(low<=high)
midB(low+high)/2.
IF (keyno < a[mid])
high = mid - 1;
ELSE IF(keyno > a[mid])
low = mid + 1;
ELSE
flag1B1
Go to Step 7
Step 7à IF (flag = = 1)
THEN Write ³ Success Element is found´
ELSE
Write ³Failure Element not found´
Step 8à End.
%
!
Start
Read number of
elements to n
i=0
i<n
i+1
Read the number ai
Read key to be
searched to keyno
flag B 0
low B 0
high B n-1
lo D
mid B 2
c
c
b high Bmid - 1
b high Bmid + 1
flag B 1
flag .EQ. 1
Write ³Failure, Write ³Success,
key element´, element´, keyno,
keyno, ³is not ³is found in the
found´ position´, mid
Stop
!"$
/* To find a keyno in a list of N numbers ordered in ascending using binary
search */
#include <stdio.h>
void main( )
{
int n, a[25], keyno, i, j;
int low,mid,high,flag;
clrscr( );
low = 0;
high = n-1;
flag = 0;
if(flag)
printf("\n\n S"CCESS! Element %d Found in Position
%d",keyno,mid+1);
else
printf("\n\n FAIL"RE! Element %d Not Found",keyno);
} /* End of main( ) */
ã$
i=0
i<n
i+1
a
Read the number i
i=0
i<n
i+1
Write ai
i=0
a
i<n-1
i+1
j=0
b j<n±i
j+1
Is aj > aj+1
temp B aj
aj B aj+1
aj+1 B temp
a
i=0
i<n
i+1
Write ai
Stop
!"$
#include <stdio.h>
void main( )
{
int n, a[25], i, j, t;
clrscr( );
printf("\n Enter the Number of Elements ? à ");
scanf("%d",&n);
printf("\n Enter the Elements ? à ");
for (i = 0; i < n; i++)
scanf("%d",&a[i]);
t = a[j];
a[j] = a[j+1];
a[j+1] = t;
}
} /* End of main( ) */
ã$
Enter the Number of Elements ? à
5
Given Array Is à
99 23 45 11 35
Sorted Array Is à
11 23 35 45 99
g1# !ã !"'!
! 'ã
/" !
67B!CC>
!11>!00>!g>!* ''!
!
?" #6.
" !!/ 7
"
Step 1à Begin
Step 2à [Read the order n and value of x].
Step 3à [Read the coefficients]
Repeat Step 3 for iB0 to n
Read a[i]
Step 4à [Initialize value of P(x)]
pxBa[n]
iBn
Step 5à [Compute Polynomial]
Repeat step 5 while i0
pxBx*px + a[i-1]
i=i-1
Step 6à [Output the polynomial]
Print px
Step 7à End.
%
!
Start
i=0
i <= n
i+1
Read the coefficient ai
px B a[n]
iBn
Is i!=0
px B x * px + a[i-1]
iBi-1
Stop
!"$
#include <stdio.h>
void main( )
{
int n,i;
clrscr( );
px = a[n];
i=n;
While (i!=0)
{
px = x * px + a[i-1];
i--;
}
} /* End of main( ) */
ã$
Enter the order of Polynomialà 5
Enter the Value of x ? à 1.5
Enter the Coefficients starting from constant term
a0=1 a1=2 a2=3 a3=4 a4=5 a5=5
Value of given polynomial is = 95.125000
gC# !ã !"! "! 6p7! 36;7! "ã
ã ! 3!& "ã!
/"
ã
! #ã ã
"! !
!"! !
! ! "!#6.
" !!/!!/ -p)));DE17
"$
Step1 à Begin
Step2 à [Input order of matrix A]
Read m,n
Step3 à [Input order of matrix B]
Read p,q
Step4 à [Check for multiplication]
if(n!=p) then,
Print µNot multiplicable¶
goto Step 9
Step5 à[Input elements of matrix A]
Count for rows
Repeat Step 5 through 6 for iB0 to m
Step6 à [Count for columns]
Repeat Step 6 for jB0 to n
Read a[i][j]
Step7 à[Input elements of matrix B]
Count for rows
Repeat Step 7 through 8 for iB0 to p
Step8 à [Count for columns]
Repeat Step 8 for jB0 to q
Read b[i][j]
Step7 à [Compute Product]
Repeat Step 7 through 9 for iB0 to m
Step8 à Repeat Step 8 through 9 for jB0 to q
prod[i][j]=0
Step9 à Repeat Step 9 for kB0 to n
c[i][j]+ = a[i][k] * b[k][j]
Step10 à[Output elements of matrix A]
Repeat Step 10 through 11 for iB0 to m
Step11 àRepeat Step 11 for jB0 to n
Print a[i][j]
Step12 à[Output elements of matrix B]
Repeat Step 12 through 13 for iB0 to p
Step13 àRepeat Step 13 for jB0 to q
Print b[i][j]
Step14 à[Output elements of resultant matrix C]
Repeat Step 14 through 15 for iB0 to m
Step15 àRepeat Step 15 for jB0 to q
Print c[i][j]
Step16à End
Start
%
!$
Read elements a
into matrix A
i=0
i<m
i+1
j=0
j <n
j+1
Read elements
into matrix A
x
x
i=0
i<p
i+1
j=0
j <q
j+1
i=0
y
i<m
i+1
j=0
j <q
j+1
cij B 0
k=0
k<n
k+1
cij B cij + aik * bkj
y
Elements of
matrix A are
i=0
i<m
i+1
j=0
j <n
j+1
Elements of
matrix B are
i=0
i<p z
i+1
j=0
j <q
j+1
Resultant
Matrix C is
i=0
i<m
i+1
j=0
j <n
j+1
Stop
!"$
/* program for matrix multiplication*/
#include <stdio.h>
#include <math.h>
int a[10][10],b[10][10],c[10][10];
void main( )
{
int m,n,i,j,p,q,k;
clrscr( );
printf("Enter the order of matrix A à ");
scanf("%d%d",&m,&n);
printf("Enter the order of matrix B à ");
scanf("%d%d",&p,&q);
if(n!=p)
{
printf("Multiplication is not possible\n");
getch( );
exit( );
}
printf("Enter the elements ( %d ) for matrix A",m*n);
for(i=0;i<m;i++)
for(j=0;j<n;j++)
scanf("%d",&a[i][j]);
printf("Enter the elements (%d) for matrix B",p*q);
for(i=0;i<p;i++)
for(j=0;j<q;j++)
scanf("%d",&b[i][j]);
printf("Given matrix A is\n");
for(i=0;i<m;i++)
{
for(j=0;j<n;j++)
printf("%d\t",a[i][j]);
printf("\n");
}
printf("Given matrix B is\n");
for(i=0;i<m;i++)
{
for(j=0;j<n;j++)
printf("%d\t",b[i][j]);
printf("\n");
}
for(i=0;i<m;i++)
for(j=0;j<q;j++)
{
c[i][j]=0;
for(k=0;k<p;k++)
c[i][j]=c[i][j]+a[i][k]*b[k][j];
}
printf("The product of the matrix is \n");
for(i=0;i<m;i++)
{
for(j=0;j<q;j++)
printf("%d\t",c[i][j]);
printf("\n");
}
getch( );
}
ã$
Matrices Multiplicable...
%
!$
Start
Read number of
elements to n
read(n)
linsrch(n,num)
Stop
read(int n)
i=0
i<n
i+1
num
Read the number i
Return
linsrch(int n,int num)
Value B0
j=0
j< n
j+1
T
num[j].EQ.Key
ValueB
j+1
F
Return Value
!"$
/* c program to conduct linear search for given key no. in an array of N nos*/
/* "sing one-dimensional arrays and function*/
#include <stdio.h>
#include<conio.h>
#include <math.h>
int num[10];
void read(int n);
int linsrch(int n,int num[10],int key);
void main( )
{
int snum;
int i,j,n,pos;
clrscr( );
printf("How many real nos. to search ?à ");
scanf("%d",&n);
printf("\n\n Enter %d nos. one by oneà \n", n);
read(n);
printf("\n type in the key (real) number to be searched for a matchà");
scanf("%d", &snum);
pos=linsrch(n,num,snum);
if (pos= =0)
{
printf("\n search failure ...!\t");
printf("Given key number %4.2d not found in the array...! \n", snum);
}
else
{
printf("\n Given key number %4.2d found at location %d in the array",snum,pos);
printf("\n Therefore successful search...!\n");
}
getch( );
}
void read(int n)
{
int i;
for(i=0;i<n;i++)
scanf("%d",&num[i]);
}
ã$
1) How many real nos. to search ?à 5
Read number of
elements to n
read(n)
Sort()
display(n)
Stop
read(int n)
i=0
i<n
i+1
a
Read the number i
return
display(int n)
i=0
i<n
i+1
Display the
array ai
return
Sort()
i=0
i < n-1
i+1
j=0
T j < n -1-i
T j+1
F F
If F
(a[j+1]>a[j])
T
tmp a[j];
a[j] a[j+1];
a[j+1] tmp
Return
!"$
/* To sort N numbers in ascending order using bubble sort using functions*/
#include <stdio.h>
#include<conio.h>
void read(int n)
{
for (i = 0; i < n; i++)
scanf("%d",&a[i]);
}
void display(int n)
{
for (i = 0; i < n; i++)
printf("\t%d",a[i]);
}
void sort(int n,int a[])
{
for (i=0; i<n-1; i++)
{
for (j=0; j<n-1-i; j++)
if (a[j+1] < a[j])
{ /* compare the two neighbors */
tmp = a[j]; /* swap a[j] and a[j+1] */
a[j] = a[j+1];
a[j+1] = tmp;
}
}
void main( )
{
clrscr( );
printf("\n Enter the Number of Elements ? à ");
scanf("%d",&n);
printf("\n Enter the Elements ? à ");
read(n);
printf("\n\n Given Array Is à\n\n");
display(n);
sort(n,a);
printf("\n\n Sorted Array Is à \n\n");
display(n);
getch( );
} /* End of main( ) */
ã$
Enter the Number of Elements ? à 4
Given Array Is à
89 45 11 64
Sorted Array Is à
11 45 64 89
g+#
6 7 ã " !
" !!/#
6 7 "
<#
6 7ã
" !!/
"#
. ) !ã !" ã "
!
" !!/)" )!
ã '!!/5 !!/ !
! #
"
Step 1àbegin
Step 2à [Input array size]
Read n
Step 3à [input elements of array]
Repeat step 3 for i0 to n
Read a[i]
Step 4à [perform selection sort]
Repeat step 4 for i 0 to n-1
iminmin(a,n,i)
Swap(a,i,ismall)
Step 5à [output sorted array]
Repeat step 5 for i0 to n
Print a[i]
Step 6à end
Step 1àbegin
Step 2à[Initialize position]
Ismall0
Step 3à [find location of minimum element]
Repeat step3 for ji+1 to n
If a[ismall]<a[j]
Ismall j
Step 4à [return the position]
Return ismall
% !ã67
Step 1à begin
Step 2à [exchange the elements]
ta[i]
a[i] a[imin]
a[imin] a[j]
Step 3à return
%
!
Start
Read number of
elements to n
i=0
i<n
i+1
a
Read the number
i
i=0
i<n
i+1
imin B MIN(a, n, i)
Swap(a,imin,i)
i=0
i<n
i+1
Write ai
Stop
ismall B i
j=i+1
j <= n
j+1
aj .GT. small
ismall B j
RET"RN - ismall
swap(int a[],int
imin,int I)
t = a[i];
a[i]=a[imin];
a[imin] = t;
Return
!"$
#include <stdio.h>
#include <conio.h>
/* "ser defined function to find the index of the minimum element in the N elements */
int min(int a[25], int n, int i)
{
int j, ismall;
ismall = i;
t = a[i];
a[i]=a[imin];
a[imin] = t;
return;
}
void main( )
{
int a[25], n, i, imin;
clrscr( );
}
printf("\nThe Final Sorted Array Is à ");
display(a,n);
getch( );
} /* End of main( ) */
ã$
i=0
i < no
i+1
Read value[i]
Return
Void maen(float value[10],int
mean)
sum B 0
i=0
i<n
i+1
Read the number ai
i=0
i<n
i+1
sum B sum + ai
sum
amean B n
Return
void variance(float
value[10],int no,float
sum B 0
i=0
i<n
i+1
a
sum B sum + (ai G amean) 2
Return
Void sid(float var)
Print sqrt(var)
Return
Start
Enter no
read(a,n);
The mean is à
mean(a,n)
The varience is à
variance(a,n,amean);
The S.D isà
sid(var)
Stop
!"$
/* To find mean, variance and standard deviation for N real numbers */
#include<stdio.h>
#include<math.h>
void read(float value[25], int no);
void mean(float value[25],int no);
void variance(float value[25],int no,float amean);
void sid(float var);
float a[10],amean, var,sum;
int n,i;
void main( )
{
clrscr( );
printf("\nEnter the no of Elements ? à \n");
scanf("%d",&n);
read(a,n);
printf("\n\nThe Mean is à ");
mean(a,n);
printf("\n\nThe Variance is à ");
variance(a,n,amean);
printf("\n\nThe Standard Deviation is à");
sid(var);
getch( );
} /* End of main( ) */
void read(float value[10], int no)
{
ã$
1
4
6
g{#
6 7!
"! '"! -p
6 7ã
"! '"! -p
6 7"ãã "!
. ) !ã !"! "! 6p7!
36;7! "ãã ! 3!
& "ã!
/"
ã
! #ã ã"!
!
!"! !
! ! "!#
6. " !!/!!/ -p)));DE17
"
Step1 à Begin
Step2 à Input order of matrix A
Read m,n
Step3 à Input order of matrix B
Read p,q
Step4 à Check for multiplication
if(n!=p) then,
Print µNot multiplicable¶
goto Step 9
Step5 àInput elements of matrix A
read(a,m,n)
Step6 àInput elements of matrix B
read(b,p,q)
Step7 à Compute Product
multiply(a,b,c,m,n,q)
Step8 à Output the result
display(c,m,q)
Step9 à End
% !
Step1 à Begin
Step2 à Count for rows
Repeat Step 2 through 3 for iB0 to r
Step3 à Count for columns
Repeat Step 3 for jB0 to s
Read mat[i][j]
Step4 à Return
% ã
!/
Step1 à Begin
Step2 à Count for rows
Repeat Step 2 through 3 for iB0 to r
Step3 à Count for columns
Repeat Step 3 for jB0 to s
Print prod[i][j]
Step4 à Return
% "
ã
/
Step1 à Begin
Step2 à Repeat Step 2 through 4 for iB0 to m
Step3 à Repeat Step 3 through 4 for jB0 to q
prod[i][j]=0
Step4 à Repeat Step 4 for kB0 to p
prod[i][j]+ = mat1[i][k] * mat2[k][j]
Step5 à Return.
%
!
Start
Write ³Matrix a
multiplicable´
READ(mat1, m, n)
READ(mat2, p, q)
DISPLAY(prod, m,q)
Stop
READ(int mat1[][],int
m,int n)
i=0
Return
i<r
i+1
j=0
j<s
j+1
i=0
Return
i<m
i+1
j=0
j <q
j+1
prodij B 0
k=0
k<p
k+1
prodij B prodij + mat1ik * mat2kj
DISPLAY(int prod[][],
int m,int q)
i=0
Return
i<r
i+1
j=0
j<s
j+1
Write prodij
!"$
/* Develop functionsà i) To read a matrix ii) To output a matrix iii) To compute
the product of two matrices */
#include <stdio.h>
#include <conio.h>
void main( )
{
float mat1[10][10], mat2[10][10], prod[10][10];
int m, n, p, q;
int i, j, k;
clrscr( );
if(n = = p)
{
printf("\nMatrices Multiplicable...");
ã$
Matrices Multiplicable...
0*# !ã !"! !"! 6p7!
$
6 7"
"ã
6 7"
"ã
"
6 7"!
""!
ã"ã
!
! #
"$
Step 1à Begin
Step 2à input the order of matrix
Read m,n
Step 3à Input the elements of matrix
Repeat step 3 through 4 for i0 to m
Step 4à Repeat step 4 for j 0 to n
Read a[i][j]
Step 5à Read the desired row
read r
Step 6à Find sum of elements of specified row
Print rowsum(r-1)
Function call
Step 7à Read the desired column
read c
Step 8à Find sum of elements of specified column
Print columnsum(c-1)
Function call
Step 9à Initialise sum to zero
Sum<- 0
Step 10àFind the sum of all elements of matrix
Repeat step 8 for I <-0 to m
Sumsum +rowsum(i)
Step 11àoutput the total sum
Print sum
Step 12à end
% "67
Step 1à begin
Step 2à initialize row sum
rs0
Step 3à sum all alements of the row
Repeat step 3 for j 0 to n
rsrs+a[i][j]
Step 4à Return sum
Return rs
%
"67
Step 1àbegin
Step 2àinitialize column sum
cs0
Step 3à sum all alements of the row
Repeat step 3 for i 0 to m
cscs+a[i][j]
Step 4à Return column sum
Return cs
%
!
Start
i=0
i<m
i+1
j=0
j<n
j+1
print ROWS"M (r-1)
c
c
Print COL"MNS"M (c-1)
write sum
Stop
sr B 0
j=0
Return sr
j<n
j+1
sr B sr + matrow,j
Int COL"MNS"M (int col)
sc B 0
i=0
Return sc
i<m
i+1
sc B sc + mati,col
sum B 0
i=0
Return sum i<m
i+1
j=0
j<n
j+1
sum B sum + matij
!"$
/* Read a matrix and find the following using functionsà i) Sum of all the elements of
each row ii) Sum of the elements of each column iii) Sum of all the elements of the
matrix */
#include <stdio.h>
#include <math.h>
#include<conio.h>
int m,n,i,j,rsum,r,c;
int a[10][10];
int rowsum(int row);
int colsum(int col);
int sumall( );
void main( )
{
clrscr( );
printf("Enter the order of matrix A à ");
scanf("%d%d",&m,&n);
printf("Enter the elements ( %d ) for matrix A",m*n);
for (i=0; i<m;i++)
for(j=0;j<n;j++)
scanf ("%d",&a[i][j]);
int sumall( )
{
int i,j,asum=0;
for(i=0;i<m;i++)
for(j=0;j<n;j++)
asum+=a[i][j];
return(asum);
}
#include <stdio.h>
#include <math.h>
int m,n,i,j,rsum,r,c;
int a[10][10];
ã$