Вы находитесь на странице: 1из 68

2

EX: NO: 1 AIM:

ADVERTISEMENT CREATION

To create an advertisement in ms-word document. PROCEDURE: 1. Open a new document using File-->New option and type text. 2. Place the di erent si!ed "oxes in the document rom the drawing tool"ar. #. Type the text in the "oxes. $. Fill the "ox with "lac% color using ill color option rom the drawing tool"ar. &. Place the appropriate logo rom the 'nsert-->Picture--> rom ile option. (. )hoose the appropriate word art gallery to place the text in "oxes. *. )hoose the +ullets or the text rom the ormatting tool"ar. ,. -se all these options to create an advertisement.

OUTPUT:

F.// )ON0-1T2T'ON
ASSET VERIFICATION PRE &POST MATRIMONIAL VERIFICATION PRE&POST EMPLOYMENT SCREENING SHADOWING OF PERSONS UNDER COVER SERVICE HANDWRITING &DOCUMENT ANALYSIS FINGER PRINT COMPARION

1& 3.0 OF /4P

1556 0/)./)3 200-./7 200-./7

FO./N0') 12+

RESULT: Thus the advertisement was created in ms-word.

$ EX: NO: 2 AIM: To create a mail merge in ms-word document. PROCEDURE: 1. 0elect 0tart--> 8icroso t word. 2. From a menu "ar select Tools-->1etters and 8ailing-->8ail 8erge. Then the mail merge window options are displayed. #. )reate a letter in the word document. $. 0elect the next option rom the mail merge window. &. To select a new list option rom the select recipient9 and the data:s in the respective window9 a ter that the create option is displayed and clic% that option. (. The new address list dialog ield "ox will "e displayed. 'n that "ox using the customi!e option to short out the entry ield and clic% o%. *. Then create the add ield records rom the mail merge ield option-->add ield-->choose the re;uired ield-->'nsert and close it. ,. Now the mail merge documents are displayed.

MAIL MERGE CREATION IN MS WORD

& OUTPUT: From9 BALAJI 1292N7 sector 9 %.%.nagar To9 <<First Name>> <<address1>> <<street no>> <<city>> 7ear Friends9 =i how are you. ' am ine here. =ow is your li e going .we are en>oying a lot here .' have >oined the ?/1 =' T/)= daily maga!ine and ' wish you or all the

/N@@ )O11/@/. ' saw your name in the


ollowing competition. 3ours lovingly BALAJI

From BALAJI 1292N7 sector 9 %.%.nagar To9 A2.T=')A 02T=328 )O8P-T/.0 NO # )=//N2' 7ear Friends9 =i how are you. ' am ine here. =ow is your li e going .we are en>oying a lot here .' have >oined the ?/1 =' T/)= daily maga!ine and ' wish you or all the

/N@@ )O11/@/. ' saw your name in the


ollowing competition. 3ours lovingly9 BALAJI

From9 BALAJI 1292N7 sector 9 %.%.nagar To9 A-82. 'NFO030 NO * )=/NN2' 7ear Friends9 =i how are you. ' am ine here. =ow is your li e going .we are en>oying a lot here .' have >oined the ?/1 =' T/)= daily maga!ine and ' wish you or all the

/N@@ )O11/@/. ' saw your name in the


ollowing competition. 3ours lovingly9 BALAJI

RESULT: Thus the mails were merged in ms-word.

EX: NO: 3

TO CREATE A STUDENT DETAILS

AIM: To create a student details in 80 /xcel with the ollowing details 0tudent Name9 .egister No.9 8ar%s9 Total 2verage and )lass o"tained. PROCEDURE: 1. /nter the students name9 no.9 and mar%s in the spread sheet. 2. Place the cursor in /29type B0-8C+2 D72E on @29type B'FCO.C+2<#&9)2<#&972<#&E 'FCF2>B(5E9 FF2'1G9'FCF2>B*&E9 #. Place the cursor in F29type B2?/.2@/C+2D7#E $. )lic% F7'0T'N)T'ONG9 FF'.0T)1200G9'FCF2>B&5E9G0/)ON7

)1200G9GT='.7 )1200GEEEE &. )opy the ormula to the remaining students. (. Finally the wor%sheet is shown.

OUTPUT:

EX:NO:3 CREATION OF STUDENT DETAILS USING FORMULA EDITOR IN MS EXCEL

NAME AJAY NAVIN DEE!A" AS$IS$ SA%ARIS$

S1 S2 S3 TOTAL AVG. 60 50 40 150 50 65 45 90 200 66.66 9# 6 #4 25# #6 60 9# 45 203 6 .66 # 56 40 1 4 5#

CLASS SECOND CLASS FIRST CLASS DISTINCTION FIRST CLASS SECOND CLASS

RESULT: Thus the student details were created in spread sheet. EX: NO: 4

TO CREATE A C$ART

15

AIM: To create a chart using student details in 80 /xcel. PROCEDURE: 1. 0elect the name and mar%s column. 2. )lic% on the chart wi!ard on the ormatting tool"ar. #. 't shows the chart wi!ard step 1 o $ chart type dialog "ox choose the chart type and clic% on next. $. 't shows the chart wi!ard step 2 o $ chart source data dialog "ox9 choose source and clic% on next. &. 't shows the chart wi!ard step # o $ chart option dialog "ox. )hoose the chart title 4-axis and 3-axis ta"les and clic% on next. (. 't shows the chart wi!ard step # o $ chart location dialog "ox. )hoose the chart location and clic% on next. *. Then clic% on inish. The chart is displayed on the monitor.

11 OUTPUT: EX:NO:4 C$ART CREATION IN MS EXCEL CLASS SECOND CLASS FIRST CLASS DISTINCTION FIRST CLASS SECOND CLASS

NAME S1 S2 S3 TOTAL AVG. AJAY 60 50 40 150 50 NAVIN 65 45 90 200 66.66 DEE!A" 9# 6 #4 25# #6 AS$IS$ 60 9# 45 203 6 .66 SA%ARIS$ # 56 40 1 4 5#

RESULT: Thus the chart was created using student details in spread sheet.

12

EX: NO: 5

TO CREATE A DE!ARTMENT DETAILS

1#

AIM: To create a department details in 80 Power point. PROCEDURE: 1. Open a "lan% presentation. 2. )hoose word art option rom the picture in 'nsert menu selection or clic% on word art "utton rom the drawing tool "ar. 2 word art gallery dialog "ox appears. #. From the word art gallery choose the appropriate style then clic% o%. 2n edit word art text dialog "ox appears9 type your text here9 and then clic% o%. $. )hoose clip art option rom the picture in 'nsert menu selection or clic% on clip art "utton rom the drawing tool "ar. &. 'nsert clip art dialog "ox appearsI rom there choose re;uired clip art then clic% o%. (. Follow the a"ove steps to complete all the slides.

1$ OUTPUT:

EX:NO:5 DE!ARTMENT DETAIL SLIDE CREATION IN MS !OWER !OINT

VEL HIGH TECH ENGG. COLLEGE


DEPARTMENT DETAILS 1ST YEAR 2006 - 2010

1&

DEPARTMENTS AVAILABLE
ELECTONICS & COMMUNICATION ENGG. (ECE) COMPUTER SCIENCE ENGG. (CSE) INFORMATION TECHNOLOGY (I T) BIO TECHNOLOGY CIVIL ENGG

RESULT: Thus the department details were created using 80 power point.

1(

1* EX: NO: 6

TO !ERFORM AN ART$METIC O!ERATIONS USING SWITC$ CASE

AIM: To write a simple menu driven calculator program using switch statement in ). ALGORITHM: 1. 0tart the program. 2. .ead the two varia"le a and ". #. /nter the option code. $. /valuate option code with case constants CaE )ase B1 cBaJ" print c C"E )ase B2 cBa-" print c CcE )ase B# cBaK" print c CdE )ase B$ cBaL" print c CeE )ase B5 exit &. /ntered case option is invalid code then print F'nvalid operation codeG. (. 0top the program

1, PROGRAM: Minclude<stdio.h> Minclude<stdli".h> Minclude<conio.h> void mainCE N int a9"9c9nI clrscrCEI print CO--8/N---PnOEI print CO1 277'T'ONPnOEI print CO2 0-+T.2)T'ONPnOEI print CO# 8-1T'P1')2T'ONPnOEI print CO$ 7'?'0'ONPnOEI print CO5 /4'TPnOEI print CO/nter your choice D OEI scan CO6dO9QnEI i Cn<B$Qn>5E N print CO/nter two num"ers D OEI scan CO6d6dO9Qa9Q"EI R switchCnE N case 1D cBaJ"I print CO2ddition D6dPnO9cEI "rea%I case 2D cBa-"I print CO0u"traction D6dPnO9cEI "rea%I case #D cBaK"I print CO8ultiplication D6dPnO9cEI "rea%I case $D cBaL"I print CO7ivision D6dPnO9cEI "rea%I case 5D exitC5EI "rea%I de aultD print CO'nvalid operation codeOEI R getchCEI R

1H

OUTPUT: --8/N--1 277'T'ON 2 0-+T.2)T'ON # 8-1T'P1')2T'ON $ 7'?'0'ON 5 /4'T /nter your choice D 1 /nter two num"ers D 2 & 2ddition D*

--8/N--1 277'T'ON 2 0-+T.2)T'ON # 8-1T'P1')2T'ON $ 7'?'0'ON 5 /4'T /nter your choice D 2 /nter two num"ers D H & 0u"traction D$

RESULT: Thus the arithmetic operations were per ormed "y using switch case.

25

EX: NO:
AIM:

TO !RINT A !ASCAL TRIANGLE

To write a ) program to print pascal:s triangle. ALGORITHM: 1. 0tart the program 2. .ead the input noline and initiali!e 1 to i #. )hec% i<Bnoline else goto step 25 $. >1. &. )hec% ><B noline else goto step H (. 'nitiali!e temp with i and Print i value. *. 'ncrement > "y 1. ,. @oto step & H. 'ncrement ' "y 1 15. @oto step #. 11. 'nitiali!e 1 to > 12. )hec% ><B' else goto 1( 1#. Print tempJJ 1$. 'ncrement > "y 1 1&. @oto step 12 1(. 8ove 1 to > 1*. 's ><1 else goto step 25 1,. Print temp- 1H. 'ncrement ' "y 1 25. 0top the program

21 PROGRAM: Minclude<stdio.h> Minclude<conio.h> void mainCE N int noline9i9>9tempI clrscrCEI print CO/nter the num"er o lines to printOEI scan CO6dO9QnolineEI orCiB1Ii<BnolineIiJJE N orC>B1I><Bnoline-iI>JJE print CO OEI tempBiI orC>B1I><BiI>JJE print CO6$dO9tempJJEI tempBtemp-2I orC>B1I><iI>JJE print CO6$dO9temp--EI print COPnPnOEI R print COPnOEI getchCEI R OUTPUT: /nter the num"er o lines to print$ 1 2 # 2 # $ & $ # $ & ( * ( & $ RESULT: Thus the pascal:s triangle was printed.

22

EX: NO: #
AIM:

TO !RE!ARE AN ELECTRICITY %ILL

To write a ) program or electricity "ill preparation. ALGORITHM: 1. 0tart the program 2. .ead 0rl.No9rect.No9+ill month9date #. )onsumedBpresent-previous $. )hec% with i condition consumed >B255CaE Total Bconsumed K2.&5 elseC"ETotal Bconsumed K1.&5 &. Print 0rl.No9rect.No9+ill month9date (. Print )onsumed9Total *. 0top the program.

2# PROGRAM: Minclude<stdio.h> Minclude<conio.h> void mainCE N int present9previous9consumed9srlnoI char nameS25T9reptnoS15T9"illmonthS1&T9dateS12TI loat totalI clrscrCEI print CO/nter 0erial Num"er Q .eceipt Num"er DOEI scan CO6d6sO9Qsrlno9reptnoEI print CO/nter +ill 8onth Q 7ate DOEI scan CO6s6sO9"illmonth9dateEI print COPresent and Previous readings DOEI scan CO6d6dO9Qpresent9QpreviousEI consumed B present-previousI i Cconsumed >B 255E totalBconsumedK2.&5I else totalBconsumedK1.&5I print COPnPtPt/1/)T.')'T3 +'11PnOEI print COPtPt--------------PnOEI print CO0) No.6dPtPtPt.eceipt.No. 6sPnO9srlno9reptnoEI print CO+ill 8onth D 6sPtPt7ate D 6sPnO9"illmonth9dateEI print COTotal cost or consumed 6d unit is .s D6 O9consumed9totalEI getchCEI R OUTPUT: /nter 0erial Num"er Q .eceipt Num"er D12# 2) 2# /nter +ill 8onth Q 7ate D(L255( Present and Previous readings D$#5 #55 /1/)T.')'T3 +'11 -------------0) No.12# .eceipt.No. 2) +ill 8onth D 2# 7ate D (L255( Total cost or consumed 1#5 unit is .s D1H&.555555 RESULT: Thus the /lectricity "ill was prepared.

2$

EX: NO: 9 TO FIND T$E VALUE OF SINE AND COSINE SERIES


AIM: To write a ) program to print sine and cosine series. ALGORITHM: SINE SERIES 1. 0tart the program 2. .ead x and n #. )onvert x values into radian using ormula xxK#.1$12L1,5 $. tx &. sumx (. 0etup or loop rom ' 1 until Ci<nJ1E increment 1 *. tCtKpowCdou"leEC-1E9Cdou"leC2Ki-1EKxKxELC2KiKC2KiJ1EE ,. sumsumJt H. Print sum 15. 0top the program COSINE SERIES 1. 0tart the program 2. 'nitiali!e n25 #. .ead x $. )onvert x values into radius using ormula xxK#.1$12L1,5 &. t19sum1 (. 0etup or loop rom ' 1 until Ci<nJ1E increment i *. tCtKpowCdou"leEC-1E9Cdou"leC2Ki-1EKxKxELC2KiKC2KiJ1EE ,. sumsumJx H. Print sum 15. 0top the program

2&

PROGRAM FOR SINE SERIES: Minclude<stdio.h> Minclude<conio.h> Minclude<math.h> void mainCE N loat x9t9sumI int i9nI clrscrCEI print CO/nter the value o x9nDOEI scan CO6 6dO9Qx9QnEI print CO6$.2 6dPnO9x9nEI xBxK#.1$12L1,5I tBxI sumBxI orCiB1Ii<nJ1IiJJE N tBCtKpowCCdou"leEC-1E9Cdou"leEC2Ki-1EEKxKxELC2KiKC2KiJ1EEI sumBsumJtI R print COThe value o 0'NC4EB6(.2 PnO9sumEI getchCEI R OUTPUT: /nter the value o x9nD$5 15 $5.55 15 The value o 0'NC4EB 5.($

2(

PROGRAM FOR COSINE SERIES: Minclude<stdio.h> Minclude<conio.h> Minclude<math.h> void mainCE N loat x9a9sum9tempI int i9noB259mulI clrscrCEI print CO/nter the value o xDOEI scan CO6 O9QxEI aBxI xBxK#.1$12L1,5I tempB1I sumB1I orCiB1Ii<noJ1IiJJE N tempBtempKpowCCdou"leEC-1E9Cdou"leEC2Ki-1EEKxKxLC2KiKC2Ki-1EEI sumBsumJtempI R print COThe cosine value o 6 is 6 O9a9sumEI getchCEI R OUTPUT: /nter the value o xD(5 The cosine value o (5.555555 is 5.&5511#

RESULT: Thus the sine and cosine series are printed.

2*

EX: NO: 10
AIM:

TO !ERFORM MATRIX MULTI!LICATION

To write a ) program to per orm matrix multiplication. ALGORITHM: 1. 0tart the program 2. .ead rows and columns limit or matrices m9n9p9; #. )hec% p is e;ual to n else goto step 12 $. 0et a loop to get 2 matrix values. &. .ead matrix value aSiTS>T (. 0et a loop to get + matrix *. .ead matrix value "SiTS>T ,. .epeat step H until i<m9><n9%<p H. dSiTS>TB5I dSiTS>TBdSiTS>TJaSiTS%TK"S%TS>T 15. 0et a loop to print matrix values. 11. Print matrix value dSiTS>T goto step 1# 12. Print the num"er o rows and columns should not "e e;ual 1#. 0top the program

2,

PROGRAM: Minclude <stdio.h> Minclude <conio.h> void main CE N int aS15TS15T9"S15TS15T9dS15TS15TI int i9>9p9;9m9n9%I clrscr CEI print CO/nter the si!e o the 2 matrixDOEI scan CO6d6dO9Qp9Q;EI print CO/nter the si!e o the + matrixDOEI scan CO6d6dO9Qm9QnEI i CpBBnE N print CO/nter the elements o 2 matrix.PnOEI or CiB5Ii<pIiJJE N or C>B5I><;I>JJE scan CO6dO9QaSiTS>TEI R print CO/nter the elements o + matrix.PnOEI or CiB5Ii<mIiJJE N or C>B5I><nI>JJE scan CO6dO9Q"SiTS>TEI R or CiB5Ii<mIiJJE N or C>B5I><nI>JJE N dSiTS>TB5I orC%B5I%<pI%JJE dSiTS>TBdSiTS>TJaSiTS%TK"S%TS>TI R Rprint CO8ultiplication o 2 and+ matrixDPnOEI or CiB5Ii<mIiJJE N or C>B5I><nI>JJE print CO6&dO9dSiTS>TEI print COPnOEI R R else

2H print COThe no. o rows and columns should not "e e;ualOEI getchCEI R

OUTPUT: /nter the si!e o the 2 matrixD2 2 /nter the si!e o the + matrixD2 2 /nter the elements o 2 matrix. 12#$ /nter the elements o + matrix. 12 2 # $ 8ultiplication o 2 and+ matrixD 1, 15 $, 22

RESULT: Thus the matrix multiplication was per ormed.

#5

EX: NO: 11
AIM:

TO !RE!ARE SALES RE!ORT

To write a ) program to prepare and print the sales report ALGORITHM: 1. 0tart the program. 2. .ead n #. 0et a loop to get a num"er o items $. .ead pid9 ;ty9 price &. total B;tyKprice (. chec% i C;ty<B155E comm.BCtotalL155EK& *. chec% i C;ty<B155E or C;ty <B2&5E comm.BCtotalL155EK15 ,. chec% i C;ty<B2&5E or C;ty<B&55E comm.BCtotalL155EK25 H. chec% i C;ty<B&55E or C;ty <B1555E comm.BCtotalL155EK2& else comm.BCtotalL155EK#5 15. 0et a loop to print the result 11. Print pid9 ;ty9 price9 total9 comm. 12. 0top the program

#1

PROGRAM: Minclude<stdio.h> Minclude<conio.h> void mainCE N int i9priceS15T9pidS15T9;tyS15T9nI int totalS15T9commS15TI clrscrCEI print COPn /nter The Num"er o Products DOEI scan CO6dO9QnEI print COPn /nter The Product '7 9 Uuantity and Price DPnOEI orCiB1Ii<BnIiJJE N scan CO6d6d6dO9QpidSiT9Q;tySiT9QpriceSiTEI totalSiTB;tySiTKpriceSiTI i C;tySiT<B155E N commSiTBCtotalSiTL155EK&I R else i C;tySiT>155 VV ;tySiT<B2&5E N commSiTBCtotalSiTL155EK15I R else i C;tySiT>2&5 VV ;tySiT<B&55E N commSiTBCtotalSiTL155EK25I R else i C;tySiT>&55 VV ;tySiT<B1555E N commSiTBCtotalSiTL155EK2&I R else N commSiTBCtotalSiTL155EK#5I R R print COPn PidPtUuantityPtPricePtTotalPt)ommissionPtOEI print COPn--------------------------------------------------OEI orCiB1Ii<BnIiJJE N print COPn6dPt6dPtPt6dPt6dPt6dPtO9pidSiT9;tySiT9priceSiT9totalSiT9commSiTEI R getchCEI R

#2

OUTPUT: /nter The Num"er o Products D& /nter The Product '7 9 Uuantity and Price D 1 15 15 2 25 25 # #5 #5 $ $5 $5 & &5 &5 Pid Uuantity Price Total )ommission -------------------------------------------------1 15 15 155 & 2 25 25 $55 25 # #5 #5 H55 $& $ $5 $5 1(55 ,5 & &5 &5 2&55 12&

RESULT: Thus the sales report was prepared and printed.

##

EX: NO: 12&'( TO CONCATINATE T$E TWO STRING WIT$OUT USING STRING FUNCTIONS
AIM: To write a ) program to concatenate the two strings without using string unctions. ALGORITHM: 1. 0tart the program 2. .ead str19 str2. #. 0et a loop to move str# to str1. $. 0et a loop to move str# to str2. &. Print str#. (. 0top the program.

#$

PROGRAM: Minclude <stdio.h> Minclude <conio.h> void main CE N char str1S15T9str2S15T9str#S$5TI int i9>I clrscr CEI print CO/nter the two stringDOEI scan CO6s6sO9str19str2EI orCiB5Istr1SiTWBXP5XIiJJE N str#SiTBstr1SiTI R orC>B5Istr2S>TWBXP5XI>JJE N str#SiTBstr2S>TI iJJI R str#SiTBXP5XI print COconcatenated string is...... 6sPnO9str#EI getchCEI R

OUTPUT: /nter the two stringD=2PP3 +'.T=723 )oncatenated string is...... =2PP3+'.T=723

RESULT: Thus the two strings were concatenated "y using ) program.

#&

EX: NO: 12( !

TO COM!ARE TWO STRINGS WIT$OUT USING STRING FUNCTIONS


AIM: To write a ) program to compare two strings without using string unctions. ALGORITHM: 1. 2. #. $. 0tart the program. .ead the two string str19 str2. 0et a loop to compare two string )hec% i Cstr1SiTBstr2SiTE Print Fthe "oth strings are e;ualG else Print Fthe "oth strings are not e;ualG &. 0top the program

#(

PROGRAM: Minclude<stdio.h> Minclude<conio.h> void mainCE N char str1S25T9str2S25TI int iI clrscrCEI print COPn /nter The First 0tring D OEI scan CO6sO9str1EI print COPn /nter The 0econd 0tring D OEI scan CO6sO9str2EI orCiB1Ii<2IiJJE N i Cstr1SiTBBstr2SiTE print COPn The +oth 0tring 's /;ual OEI else print COPn The +oth 0trings 's Not /;ualOEI R getchCEI R

OUTPUT: /nter The First 0tringD )O8P-T/. /nter The 0econd 0tringD computer The +oth 0trings 's Not /;ual

RESULT: Thus the two strings were compared without using string unctions in ).

#*

EX: NO: 12( !

TO FIND T$E LENGT$ OF T$E STRING WIT$OUT USING STRING FUNCTIONS


AIM: To write a ) program to compare two strings without using string unctions. ALGORITHM: 1. 0tart the program. 2. .ead the str #. 0et the or loop to calculate length o the string. $. Print length o the string using varia"le len. &. 0top the program. PROGRAM: Minclude<stdio.h> Minclude<conio.h> void mainCE N char strS&5TI int lenI clrscrCEI print CO/nter the string DOEI scan CO6SYPnTO9strEI orClenB5IstrSlenTWBXP5XIlenJJEI print CO1ength o main string is 6dPnO9lenEI getchCEI R OUTPUT: /nter the stringD )O8P-T/. P.O@.28 1ength o main string is 1(

RESULT:

#, Thus the length o the string was calculated without using string unctions in ). EX: NO: 12( "!

TO CO!Y T$E STRING WIT$OUT USING STRING FUNCTIONS


AIM: To write a ) program to copy the string without using string unctions. ALGORITHM: 1. 0tart the program. 2. .ead the str1 #. 0et a loop to copy a string1 to string 2. $. Print Fthe copied string str2G. &. 0top the program. PROGRAM: Minclude<stdio.h> Minclude<conio.h> void mainCE N int iI char str1 S&5T9str2 S&5TI clrscrCEI print COPn/nter the irst string DOEI scan CO6sO9str1EI print COThe irst string is 6sO9str1EI orCiB5Istr1SiTWBXP5XIiJJE N str2SiTBstr1SiTI R str2SiTBXP5XI print COPn copy the string 1to string 2 without using strcpyCE unctionOEI print COPn The copied string is 6sO9str2EI getchCEI R OUTPUT: /nter the irst stringD =2.7Z2./ The irst string is =2.7Z2./ copy the string 1to string 2 without using strcpyCE unction The copied string is =2.7Z2./ RESULT:

#H Thus the strings were copied without using string unctions in ). EX: NO: 13 TO ARRANGE NAMES IN AL!$A%ETICAL ORDER AIM: To write a ) program to arrange the names in alpha"etical order using string manipulations. ALGORITHM: 1. 0tart the program 2. n5 #. .ead strings into nameSnT until the entered string F/N7G $. 0etup or loop rom i59 until i<n-1 increment i &. 0etup or loop rom >5 until ><n increment >. (. )ompare i strcmpCnamesSiT9namesS>T>5Eelse goto step & TempnamesSiT NamesSiTnamesS>T NamesS>Ttemp *. 0etup or loop rom '5 until i<n increment i ,. Print namesSiT H. 0top the program.

$5

PROGRAM: Minclude<stdio.h> Minclude<conio.h> Minclude<string.h> void mainCE N char namesS25TS25T9tempS15T9cI int i9>9%9nB5I clrscrCEI print COPn /nter Names To 0top Type Aeyword /N7 ........D OEI scan CO6sO9namesSnTEI whileCstrcmpCnamesSnT9O/N7OE>5E N nJJI scan CO6sO9namesSnTEI R print COPnOEI orCiB5Ii<nIiJJE print COPn 615sO9namesSiTEI print COPnOEI print COPnOEI print COPn Num"er O Names ......6dO9nEI orCiB5Ii<n-1IiJJE orC>BiJ1I><nI>JJE N i CstrcmpCnamesSiT9namesS>TE>5E N strcpyCtemp9namesSiTEI strcpyCnamesSiT9namesS>TEI strcpyCnamesS>T9tempEI R R print COPn 2 ter 0orting The Names 2re .....OEI orCiB5Ii<nIiJJE print COPn 615sO9namesSiTEI print COPnOEI getchCEI R

$1

OUTPUT: /nter Names To 0top Type Aeyword /N7 ........D Naveen 0a"rish 8anish [aco" /N7 Naveen 0a"rish 8anish [aco" Num"er O Names ......$ 2 ter 0orting The Names 2re ..... [aco" 8anish Naveen 0a"rish

RESULT: Thus the names were arranged in alpha"etical order using ) program.

$2

EX: NO: 14

TO CALCULATE T$E MEAN) VARIANCE) * STANDARD DEVIATION USING FUNCTIONS


AIM: To write a ) program to calculate the mean9 variance and standard deviation using unctions. ALGORITHM: 1. 0tart the program 2. .ead the varia"le n. #. 0et a loop to get list. $. .ead list &. 0et a loop to print list (. Print list *. 7eviationBsdClist9nE ,. ?arianceBvaClist9nE H. Print variance 15. Print 7eviation. F#$%& '$ :()(*+,! 1. meanBavgCE 2. Print m9mean #. 0et a or loop to calculate sum $. sumBsumJCmean-xSiTEKCmean-xSiTE &. devBs;rtCsumLC loatEmE (. .eturn dev *. 0top the program F#$%& '$: "-(*+,! 1. 8eanBavgCx9mE 2. 0et a or loop to calculate sum. #. sumBsumJCmean-xSiTEKCmean-xSiTE $. varBsumLC loatEm

$# &. .eturn var (. 0top the program. F#$%& '$: -". (-+$! 1. 0et a loop to calculate sum 2. sum BsumJaSiT #. .eturn CsumLC loatEnE $. 0top the program. PROGRAM: Minclude<stdio.h> Minclude<conio.h> Minclude<math.h> void mainCE N int i9nI loat deviation9variance9listS25TI loat sdCE9vaCEI clrscrCEI print CO0tandard 7eviationPnOEI print CO/nter the -pper 1imit...OEI scan CO6dO9QnEI print CO/nter the 6d elementsPnO9nEI orCiB5Ii<nIiJJE scan CO6 O9QlistSiTEI orCiB5Ii<nIiJJE print CO6(.2 O9listSiTEI deviationBsdClist9nEI varianceBvaClist9nEI print CO?ariation is D 6(.& PnO9varianceEI print CO0tandard 7eviation is D 6(.& PnO9deviationEI getchCEI R loat sdCx9mE loat xS25TI int mI N int iI loat mean9dev9sumB5.5I 0.[232A-82.9 loat avgCEI meanBavgCx9mEI print COPn8ean o 62d elements is D 6&.2 PnO9m9meanEI

$$ orCiB5Ii<mIiJJE sumBsumJCmean-xSiTEKCmean-xSiTEI devBs;rtCsumLC loatEmEI returnCdevEI R loat vaCx9mE loat xS25TI int mI N int iI loat mean9var9sumB5.5I loat avgCEI meanBavgCx9mEI orCiB5Ii<mIiJJE sumBsumJCmean-xSiTEKCmean-xSiTEI varBsumLC loatEmI returnCvarEI R loat avgCa9nE loat aS25TI N int iI loat sumB5.5I orCiB5Ii<nIiJJEI sumJBaSiTI returnCsumLC loatEnEI R OUTPUT: /nter the -pper 1imit...& /nter the & elements #&2$* #.55 &.55 2.55 $.55 *.55 8ean o & elements is D 5.55 ?ariation is D 25.(5555 0tandard 7eviation is D $.&#,*2

RESULT: Thus the mean9 variance and standard deviation were calculated "y using unctions in ).

$&

EX: NO: 15

TO !ERFORM SE+UENTIAL SEARC$ AND %INARY SEARC$ USING FUNCTIONS


AIM: To write a ) program to per orm se;uential search and "inary search using unctions. SE/UENTIAL SEARCH ALGORITHM: 1. 0tart the program. 2. 1IcB:y: #. .epeat steps # through step 11 until cB:y: or cB:y: $. .ead upper limit n. &. 0etup or loop i5I until i<nI increment i (. .ead num"ers into array 2. *. .ead which element to search in array \%: ,. 0etup or loop i5I i<nI increment i H. /valuate i C%BBgSiTE TD Print oundI 2 15. 's B1 print not ound 11. .epeat once i yes reach ch goto step # 12. 0top the program.

$(

BINAR0 SEARCH ALGORITHM: 1. 0tart the program. 2. 1 #. .ead upper limit o array \n:. $. 0etup or loop rom i1I until i<nI increment i &. .ead element to array \2: (. .ead element to "e search in array \n: *. i59hBn-1 ,. .epeat step H to 15 until Cl<BhE H. mC1JhEL2 15. 's Ct<aSmTE TDnBm1 FD'sCt>aSmTE TDlmJ1 FD ound in mJ1 position F2 /xit 11. 's FB1 TD Print not ound 12. 0top the program

$*

SE/UENTIAL SEARCH PROGRAM: Minclude<stdio.h> Minclude<conio.h> mainCE N int i9>9%9no9aS155T9 B1I char c B XyX9chI clrscrCEI whileCcBBXyXVVcBBX3XE N print COPn /nter the si!e o sortingOEI scan CO6dO9QnoEI print COPn /nter the elements o the arrayOEI orCiB5Ii<noIiJJE scan CO6dO9QaSiTEI print COPn /nter the element to "e searchedOEI scan CO6dO9Q%EI orCiB5Ii<noIiJJE N i C%BBaSiTE N print COPn /lement 6d is in the position 6dO9%9iJ1EI B2I "rea%I R R i C BB1E print COPnThe entered element is not in the arrayOEI print COPn' you want to continue yLnOEI chBgetchCEI cBchI R getchCEI R OUTPUT: /nter the si!e o sorting& /nter the elements o the array# ( & 1 H5

$, /nter the element to "e searched& /lement & is in the position # ' you want to continue yLn BINAR0 SEARCH PROGRAM: Minclude<stdio.h> Minclude<conio.h> mainCE N int aS155T9i9no9l9h9m9t9 B1I clrscrCEI print CO/nter the si!e o the arrayPnOEI scan CO6dO9QnoEI print CO/nter the elements in ascending orderOEI orCiB5Ii<noIiJJE scan CO6dO9QaSiTEI print CO/nter the elements to "e searchedOEI scan CO6dO9QtEI lB5I hBno-1I whileCl<BhE N mBClJhEL2I i Ct<aSmTE hBm-1I else i Ct>aSmTE tBmJ1I else N print COPn /ntered 6d is in position 6dO9t9mJ1EI B2I "rea%I R R i C BB1E print COPn /ntered element is not in the arrayOEI getchCEI R OUTPUT: /nter the si!e o the array & /nter the elements in ascending order2 $ ( , 15 /nter the elements to "e searched(

$H /ntered ( is in position # RESULT: Thus the se;uential search and "inary search were per ormed "y using unctions. EX: NO: 16 AIM: To write a ) program to print the Fi"onacci series using unctions. ALGORITHM: 1. 0tart the program 2. .ead upper limit n #. )all unction i"CnE $. 0top the program FunctionD i" CnE 1. )hec% i Cn<2E 119 21 else )all i" Cn-1E Temp 2 F2 1J 2 F1temp 2. Print 1 #. 0top the program

TO !RINT FI%ONACCI SERIES USING FUNCTIONS

&5

PROGRAM: Minclude<stdio.h> Minclude<conio.h> void mainCE N int a9recCintEI print COPn /nter The Num"er D OEI scan CO6dO9QaEI print COThe Factorial O 6d B 6dO9a9recCaEEI getchCEI R recCint xE N int I i CxBB1E returnC1EI else BxKrecCx-1EI returnC EI R

OUTPUT: /nter The Num"er O Terms D , F'+ON2))' 0e;uence upto , terms D 5 1 1 2 # & , 1#

&1

RESULT: Thus the Fi"onacci series was printed "y using unctions. EX: NO: 11

TO FACTORIAL OF T$E GIVEN NUM%ER USING FUNCTIONS


AIM: To write a ) program to ind the actorial o the given num"er. ALGORITHM: 1. 0tart the program 2. .ead input value a #. actorialCxE $. Print x9 &. 0top the program FunctionD actorial Cint nE 1. act1 Fact act x9n Nn-1 #. .eturnC actE 2. )hec% whileCn>1Eelse goto step #

&2

PROGRAM: Minclude<stdio.h> Minclude<conio.h> void mainCE N int a9recCintEI print COPn /nter The Num"er D OEI scan CO6dO9QaEI print COThe Factorial o 6d B 6dO9a9recCaEEI getchCEI R recCint xE N int I i CxBB1E returnC1EI else BxKrecCx-1EI returnC EI R

OUTPUT: /nter The Num"er D & The Factorial O & B 125

RESULT: Thus the actorial o a given num"er was calculated.

&#

EX: NO: 12

TO DIS!LAY A STUDENT MAR" LIST USING STRUCTURE


AIM: To write a ) program to print student grade using structure. ALGORITHM: 1. 0tart the program 2. 7e ine structure stud with the mem"ers rollnoDinteger nameS#5TDcharacter mar%19mar%29mar%#9totalDinteger avgD loat gradeDcharacter /nd stud #. .ead input n $. 0et a loop to get record details &. .ead aSiT.rollno9aSiT.name (. aSiT.mar%19 aSiT.mar%29 aSiT.mar%# *. aSiT.totalBaSiT.mar%1J aSiT.mar%2J aSiT.mar%# ,. aSiT.avgBaSiT.totalL# H. S/nd o step$T 15. )hec% i aSiT.avg<$5 then assign aSiT.gradeB7 11. )hec% i aSiT.avg<(5 then assign aSiT.gradeB) 12. )hec% i aSiT.avg<,5 then assign aSiT.gradeB+ else 1#. aSiT.gradeB:2: 1$. Print aSiT.rollno9aSiT.name9aSiT.mar%19aSiT.mar%29aSiT.mar%#9aSiT.total9aSiT.avg9aSiT.grade 1&. 0top the program.

&$

PROGRAM: Minclude<stdio.h> Minclude<conio.h> struct std Nint sno9m19m29m#9m$9m&9m(9totI char nameS15T9gradeI loat avgI RsS15TI void mainCE N loat avgI int tot9n9iI clrscrCEI print COenter the num"er o students to process.....OEI scan CO6dO9QnEI print COenter student num"er9name and ( su">ect mar%s.....PnOEI orCiB1Ii<BnIiJJE N scan CO6d6s6d6d6d6d6d 6dO9QsSiT.sno9sSiT.name9QsSiT.m19QsSiT.m29QsSiT.m#9QsSiT.m$9QsSiT.m&9QsSiT.m(EI sSiT.totBsSiT.m1JsSiT.m2JsSiT.m#JsSiT.m$JsSiT.m&JsSiT.m(I sSiT.avgBsSiT.totL(I i CsSiT.m1<#&VVsSiT.m2<#&VVsSiT.m#<#&VVsSiT.m$<#&VVsSiT.m&<#&VVsSiT.m(<#&E sSiT.gradeBXFXI else N i CsSiT.avg>B*&E sSiT.gradeBX7XI else i CsSiT.avg<*& QQ sSiT.avg>B(5E sSiT.gradeBXFXI else i CsSiT.avg<(5 QQ sSiT.avg>B&5E sSiT.gradeBX0XI else i CsSiT.avg<&5 QQ sSiT.avg>B#&E sSiT.gradeBXTXI R R print COstudent mar%s list are....PnOEI print COs.noPtnamePttotalPtaveragePtgradePnOEI print CO]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]PnOEI orCiB1Ii<BnIiJJE

&& N print CO6dPt6sPt6dPt6 Pt6cO9sSiT.sno9sSiT.name9sSiT.tot9sSiT.avg9sSiT.gradeEI print COPnOEI getchCEI RR OUTPUT: enter the num"er o students to process.....2 enter student num"er9 name and ( su">ect mar%s..... 1551 "alu &( *, ,H H5 *, H, 1552 ra>ee *( &* #5 *, HH &( student mar%s list are.... s.no name total average grade ]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]] 1551 "alu $,H ,1.555555 7 1552 ra>ee #H( ((.555555 F

RESULT: Thus the student mar% list was prepared and printed "y using structure in ).

&(

EX: NO: 13

TO COUNT T$E NUM%ER OF OCCURRENCES OF T$E ELEMENT IN AN ARRAY


To write a ) program using pointers to access the elements o an array and count

AIM: the num"er o occurrences o the given num"er in the array. ALGORITHM: 1. 0tart the program 2. .ead the upper limit varia"le \n: #. 0et a loop to get a num"er o elements. $. .ead aSiT &. .ead varia"le m (. 0et up or loop to chec% or same num"er present in the array. *. )hec% i CaSiTBmE nocBnocJ1 ,. Print the values m9noc H. 0top the program

&*

PROGRAM: Minclude<stdio.h> Minclude<conio.h> void mainCE N int KaI int i9n9m9nocB5I clrscrCEI print COenter upper limit....D OEI scan CO6dO9Qn EI orCiB1Ii<BnIiJJE N scan CO6dO9QaSiTEI R print COenter the num"er to ind in array....D OEI scan CO6dO9QmEI orCiB1Ii<BnIiJJE N i CaSiTBBmE nocJJI R print CO6d occured in 6d times....O9m9nocEI getchCEI R OUTPUT: /nter -pper limit.... ( (,&$,, /nter the num"er to ind in array...... , , Occured in # times..

RESULT: Thus the num"er o occurrences o a given element was calculated "y using ).

&,

EX: NO: 24 AIM:

TO !ERFORM INVENTORY MANAGEMENT USING FILES

To write a ) program or inventory management using iles. ALGORITHM: 1. 0tart the program 2. Open a ile F'nvG in write mode #. .ead the upper limit value \n: $. 0et a loop to get code9 ;uantity and price. &. .ead codeSiT9;tySiT9priceSiT (. ?alueSiTB;tySiTKpriceSiT *. Print a varia"le codeSiT9;tySiT9priceSiT9valueSiT in to the ile ,. )lose ile pointer. H. Open a ile F'nvG in read mode 15. 0et a loop to print code9 ;uantity9 price and value. 11. .ead the data rom ile codeSiT9;tySiT9priceSiT and valueSiT 12. Print codeSiT9;tySiT9priceSiT and valueSiT 1#. )lose ile pointer 1$. 0top the program

&H

PROGRAM: Minclude<stdio.h> Minclude<conio.h> void mainCE N F'1/ K pI int i9>9codeS15T9;tyS15T9nI loat priceS15T9valueS15TI pB openCO'N?O9OwOEI clrscrCEI print CO/nter the upper limit....OEI scan CO6dO9QnEI print CO/nter the )O7/9U-2NT'T39P.')/Pn OEI orCiB1Ii<BnIiJJE N scan CO6d6d6 O9QcodeSiT9Q;tySiT9QpriceSiTEI valueSiTB;tySiTKpriceSiTI print C p9O6d6d6 6 O9codeSiT9;tySiT9priceSiT9valueSiTEI R closeC pEI print COPnOEI pB openCO'N?O9OrOEI print CO)O7/ U-2NT'T3 P.')/ ?21-/PnOEI print CO-------------------------------PnOEI orCiB1Ii<BnIiJJE N scan C p9O6d6d6 6 O9QcodeSiT9Q;tySiT9QpriceSiT9QvalueSiTEI print CO6dPt6dPt6&.2 PnO9codeSiT9;tySiT9priceSiT9valueSiTEI R closeC pEI getchCEI R

(5

OUTPUT: enter the upper limit...& enter )O7/9 U-2NT'T39 P.')/ 15 &( 255 11 *, #55 12 &( *55 1# (, #55 1$ (* ,55 )O7/ U-2NT'T3 P.')/ ?21-/ ]]]]]]]]]]]]]]]]]]]]]] *(2$ &( 255.55 11255.55 11 *, #55.55 2#$55.55 12 &( *55.55 #H255.55 1# (, #55.55 25$55.55 1$ (* ,55.55 &#(55.55

RESULT: Thus the inventory management was per ormed "y using iles in ).

(1

EX: NO: 21 AIM:

TO CREATE AND DIS!LAY A LIN"ED LIST


To write a ) program or creating and displaying a lin%ed list.

ALGORITHM: 1. 0tart the program 2. 7eclare structure lin%ed]list with mem"ers. #. )all su"]program createCnodeKpE $. )all su"]program countCnodeKpE &. )all su"]program printCnodeKpE (. headBCnodeKEmallocCsi!e o CnodeEE *. )all su"]program createCheadE ,. )all su"]program printCheadE H. Print countCheadE 15. 0top the program.

(2

PROGRAM: Minclude<stdio.h> Minclude<stdli".h> Minclude<conio.h> struct lin%ed]list N int num"erI struct lin%ed]listKnextI RI typede struct lin%ed]list nodeI void mainCE N nodeKheadI void createCnode KpEI int countCnode KpEI void printCnode KpEI clrscrCEI headBCnodeKEmallocCsi!eo CnodeEEI createCheadEI print COPnOEI printCheadEI print COPnOEI print CONum"er o itemsB6d PnO9countCheadEEI getchCEI R void createCnode K listE N print CO'nput a num"er DPnOEI print COType -HH to stopDOEI scan CO6dO9Qlist->num"erEI i Clist->num"erBB -HHE N list -> next B N-11I R else N list->nextBCnode KEmallocCsi!eo CnodeEEI createClist->nextEI R returnI R void printCnode KlistE

(# N i Clist-> nextWBN-11E N print CO6d-->O9list-> num"erEI i Clist->next->nextBBN-11E print CO6dO9list->next->num"erEI printClist-> nextEI R returnI R int count Cnode KlistE N i Clist-> nextBBN-11E returnC5EI else returnC1JcountClist->nextEEI R

OUTPUT: 'nput a num"er D Type -HH to stopD25 'nput a num"er D Type -HH to stopD$5 'nput a num"er D Type -HH to stopD$5 'nput a num"er D Type -HH to stopD&5 'nput a num"er D Type -HH to stopD$5 'nput a num"er D Type -HH to stopD-HH 25-->$5-->$5-->&5-->$5-->-HH Num"er o itemsB&

RESULT: Thus the lin%ed list was created and displayed using ).

($

EX: NO: 22

TO MERGE TWO FILES USING COMMAND LINE ARGUMENTS


AIM: To write a ) program to merge the given two iles using command line arguments. ALGORITHM: 1. 0tart the program 2. 7eclare character varia"leKargvST ile ptrK pIK p2I p# #. )hec% i CargcWB$E Print argc9else $. Print argvS1T &. )hec% while CreadC'WB/OFEE Put wC'9 p1E )1B)1J1 (. )lose ile pointerC p1E *. Print Cc19argvS1TE ,. p1B open CargvS1T9GrGE H. )hec% while C'BgetwC p1EWB/OFE 15. print i 11. )lose ile pointerC p1E 12. Print argvS2T 1#. p2B openCargvS2T9GwGE 1$. )hec% whileCread >WB/OFE Put wC>9 p2E )2B)2J1 1&. )lose ile pointerCF2E 1(. 0top the program.

(&

PROGRAM: Minclude<stdio.h> Minclude<conio.h> void mainCint argc9char KargvE N F'1/ K p19K p29K p#I int i9>9%9n19n29c1B59c2B59c#9dupB5I clrscrCEI i CargcWB$E N print CONo. o arguments on command line B 6dPnO9argcEI print CO-sage D a.out arg1 arg2 arg# PnPnOEI R else N print CONum"ers in the 2 iles should "e in ascending orderPnOEI print COTerminate entry o each ile with )trl-dC/OFEPnOEI print COPn'nput num"ers or ile 6sPnO9argvS1TEI p1B openCargvS1T9OwOEI whileCCscan CO6dO9QiEE WB/OFE N putwCi9 p1EI c1JJI R closeC p1EI print COPn1ist o 6d num"ers in ile 6sPnO9c19argvS1TEI p1B openCargvS1T9OrOEI whileCCiBgetwC p1EE WB/OFE print CO6&dO9iEI closeC p1EI print COPnOEI print COPn'nput num"ers or ile 6sPnO9argvS2TEI p2B openCargvS2T9OwOEI whileCCscan CO6dO9Q>EE WB/OFE N putwC>9 p2EI c2JJI R closeC p2EI print COPn1ist o 6d num"ers in ile 6sPnO9c29argvS2TEI p2B openCargvS2T9OrOEI

(( whileCC>BgetwC p2EE WB/OFE print CO6&dO9>EI closeC p2EI print COPnOEI c#Bc1Jc2I iB5I >B5I p1B openCargvS1T9OrOEI p2B openCargvS2T9OrOEI p#B openCargvS#T9OwOEI n1BgetwC p1EI n2BgetwC p2EI whileCCiWB c1E QQ C> WBc2EE N i Cn1<n2E N putwCn19 p#EI n1BgetwC p1EI iJJI R else N i Cn1>n2E N putwCn29 p#EI n2BgetwC p2EI >JJI R else N putwCn19 p#EI n1BgetwC p1EI n2BgetwC p2EI iJJI >JJI dupJJI R R R i CiBBc1E N do N putwCn29 p#EI R whileCCn2BgetwC p2EEWB/OFEI

(* R else N do N putwCn19 p#EI R whileCCn1BgetwC p1EE WB/OFEI R closeC p1EI closeC p2EI closeC p#EI print COPn1ist o 6d num"ers in ile 6sPnO9c#-dup9argvS#TEI print CO2 ter simple]merge]sort D PnPnOEI p# B openCargvS#T9OrOEI whileCC%BgetwC p#EEWB/OFE print CO6&dO9%EI closeC p#EI print COPnOEI R R OUTPUT: Num"ers in the 2 iles should "e in ascending order Terminate entry o each ile wit ctrl-d C/OFE 'nput num"ers or ile 1 1ist o & num"ers in ile 1 $ , 1H 2* $, input num"ers or ile 2 list o * num"ers in ile 2 * 11 1, 2, #1 $5 $, list o 11 num"ers in ile # a ter simple]merge]sort D $ * H 11 1, 1H 2* 2, #1 $5 $,

RESULT: Thus the given two iles were merged "y using command line arguments.

(,

Вам также может понравиться