I bsc lab programs

download I bsc lab programs

of 77

Transcript of I bsc lab programs

  • 8/13/2019 I bsc lab programs

    1/77

  • 8/13/2019 I bsc lab programs

    2/77

    '

  • 8/13/2019 I bsc lab programs

    3/77

    MAIL MERGE

    Aim:Create an inter"iew call letter as the main doc*ment and create 3 records for 3

    persons. 5se mail merge to create a common letter to all these fo*r.

    Proced*re:

    tep -:tart M ord

    tartProgramsM ord

    tep ': It opens the M ord editor. Clic/ on Tools and select Mail Merge ,ption.

    tep#:It opens the mail merge helper window. Clic/ on Create )*tton and select form

    letters option. pecify the window in which it has to create the records.

    tep 3: Clic/ on Acti"e indow.tep $: Clic/ on 6et Data )*tton and select Create data o*rce option. It opens create data so*rce window in which we select the fields re7*ired for o*r mail. Clic/ on

    ,K 8*tton and pro"ide the file name.

    tep 9: Clic/ on dit Data o*rce It opens the Data 0orm window and we need to pro"ide the details. 0inally clic/ on ,K

    tep ;: rite yo*r letter.

    tep >A8C?? 8*tton to Merge the "al*es.

    tep -2:Clic/ on Merge 8*tton. It opens the Merge options. elect Merge and Clic/ ,K.

    #

  • 8/13/2019 I bsc lab programs

    4/77

  • 8/13/2019 I bsc lab programs

    5/77

    Tir*pati1

    '

  • 8/13/2019 I bsc lab programs

    6/77

    Tir*pati1

    '

  • 8/13/2019 I bsc lab programs

    7/77

    Tir*pati1

    '

  • 8/13/2019 I bsc lab programs

    8/77

    Tir*pati1'

  • 8/13/2019 I bsc lab programs

    9/77

    MACRO

    Aim :rite a MACG, to format a doc*ment as gi"en )elow.

    -. Line spacing '

    '. Paragraph indent of 2.-2#. E*stification formatting tyle

    3. Arial font of -$Pt i!e.

    Proced*re:

    tep -:tart M ord

    tartProgramsM ord

    tep ': It opens the M ord editor. Clic/ on Tools and select Macros s*)men* and select the Gecord (ew Macro option.

    tep #: It opens the record macro window.

    tep 3: Clic/ on Key 8oard option. It opens the C*stomi!e /ey)oard window. Pro"ide the hort c*t /ey and clic/ on Assign )*tton. And Clic/ on Close 8*tton.

    tep $:(ow the recording is got started.

    tep 9: elect the format Men* and Clic/ on Paragraph option and change the Line

    spacing to do*)le.

    tep ;: elect the indentation to 2.-2

    tep

  • 8/13/2019 I bsc lab programs

    10/77

    TYPES OF SOFTWARE

    Software is a set of electronic instructions that tells the computer how to do certain tasks. A setof instructions is often called a program. When a computer is using a particular program, it is said to

    be running or executing the program.The two most common types of programs are system software and application software.

    System Software

    System software exists primarily for the computer itself, to help the computer perform specificfunctions.

    One major type of system software is the operating system OS!. All computers re"uire anoperating system. The OS tells the computer how to interact with the user and its own de#ices.$ommon operating systems include Windows, the %acintosh OS, OS&', and ()*+ .

    When we turn on a computer, it goes se#eral steps to prepare itself for use. The first step iscalled the poweron self test -OST!. The computer identifies the de#ices attached to it, identifies theamount of memory a#ailable, and does a "uick check to see whether the memory is functioning

    properly.ApplicationSoftware

    Application software tells the computer how to accomplish tasks the user re"uires, such ascreating a document or editing a graphic image.

    Some important kinds of application software are

    Application software tells the computer how to accomplish tasks the user re"uires, such ascreating a document or editing a graphic image.

    Some important kinds of application software are %SO//*$0, TA112, etc

    3

  • 8/13/2019 I bsc lab programs

    11/77

    TYPES OF SOFTWARE

    Software is a set of electronic instructions that tells the computerhow to do certain tasks. A set of instructions is often called a program.When a computer is using a particular program, it is said to be running

    or executing the program.

    The two most common types of programs are system softwareand application software.

    System Software

    System software exists primarily for the computer itself, to helpthe computer perform specific functions.

    One major type of system software is the operating system OS!.

    All computers re"uire an operating system. The OS tells the computerhow to interact with the user and its own de#ices. $ommon operatingsystems include Windows, the %acintosh OS, OS&', and ()*+ .

    When we turn on a computer, it goes se#eral steps to prepareitself for use. The first step is called the poweron self test -OST!. Thecomputer identifies the de#ices attached to it, identifies the amount ofmemory a#ailable, and does a "uick check to see whether the memoryis functioning properly.

    Application SoftwareApplication software tells the computer how to accomplish tasks

    the user re"uires, such as creating a document or editing a graphicimage.

    Some important kinds of application software are

    Application software tells the computer how to accomplish tasksthe user re"uires, such as creating a document or editing a graphicimage.

    Some important kinds of application software are %SO//*$0,TA112, etc

    $

  • 8/13/2019 I bsc lab programs

    12/77

    CONVERSIONS

    Aim:

    To create an electronic spread sheet in which yo* enter the following Decimal n*m)ers andcon"ert them into ,ctal1 He&a decimal and 8inary n*m)ers "ice "ersa.

    Proced*re:

    tep -: tart M &cel

    tartProgramsM &cel

    tep ':elect Add+ins from tools men* and select the analysis toolpac/ chec/ )o&.

    tep #:6i"e the necessary headings li/e Decimal1 8inary1 ,ctal1 He&a Decimal in the first row.

    tep 3:6i"e the Decimal n*m)er in the Decimal heading col*mn.tep $:6o to 8inary col*mn and gi"e the form*la as dec')in Jcell address.

    tep 9:6o to ,ctal col*mn and gi"e the form*la as dec'oct Jcell address.

    tep ;:6o to He&a decimal col*mn and gi"e the form*la as dec'he& Jcell address.

    tep

  • 8/13/2019 I bsc lab programs

    13/77

    CONVERTING FRO !EC TO "IN#OCT AN! $E%A!ECIA&

    !ECIA& "INARY OCTA& $E%A!ECIA&

    34 566655 73 '3

    89 5666566 567 77:4 5655555 53; 4/

    584 56566565 '74 A4

    ''4 55566665 375 05

    344 565566655 473 583

    3;4 565556555 48; 5;;

    784 555656665 ;'5 5

  • 8/13/2019 I bsc lab programs

    14/77

    STUDENT RESULT

    Aim:Create a *ita)le e&amination data)ase and find the s*m of the mar/s of each st*dent and the

    respecti"e class sec*red )y the st*dent.

    Pass #$

    Distinction ;$

    0irst class 92

    econd Class $2

    Third Class #$

    Proced*re:

    tep -:tart M &cel

    tartProgramsM &cel

    tep ':Pro"ide the (ecessary data.

    tep #:In the Total 0ield for the 0irst Gecord rite the following form*la.D3N3N03

    tep 3:Drag it *p to the end of this col*mn.

  • 8/13/2019 I bsc lab programs

    15/77

  • 8/13/2019 I bsc lab programs

    16/77

    ST'!ENT !ETAI&S

    Sno Sname S()* S()+ S(), Total A-era.e Res(lt Class

    5665 Arun. > 566 566 566 366 566.66 -ass

  • 8/13/2019 I bsc lab programs

    17/77

    PRODUCT CHART

    Aim:The KAL InfoTech company shows the sales of Different prod*cts for $ years. Create 8argraph1

    #D and Pie Charts for the following.

    2ear -roduct5 -roduct' -roduct3 -roduct7

    5:9: 5666 966 :66 5666

    5::6 9666 96 466 :66

    5::5 5'66 5:6 766 966

    5::' 766 '66 366 5666

    5::3 5966 766 766 5'66

    Proced*re:

    tep -:tart M &cel

    tartProgramsM &cel

    tep ':Pro"ide the (ecessary data.

    tep #:elect the data and clic/ on Charts wi!ard.

    tep 3:It opens the charts wi!ard and yo* select the Col*mn ,ption and clic/ the ne&t )*tton.

    --

  • 8/13/2019 I bsc lab programs

    18/77

    tep $:In the ne&t window clic/ on the ne&t )*tton.

    tep 9:In the ne&t window Pro"ide the Chart title as KAL InfoTech ales Chart

    tep ;:In the 4 A&is pro"ide the title as Bear

    tep

  • 8/13/2019 I bsc lab programs

    19/77

    Bar Chart

    /A& InfoTec0 Sales C0art

    6

    466

    5666

    5466

    '666

    5:9: 5::6 5::5 5::' 5::3

    Years

    Sales

    -roduct5

    -roduct'

    -roduct3

    -roduct7

    3D Chart

    6

    466

    5666

    5466

    '666

    Sales

    5:9: 5::6 5::5 5::' 5::3

    Years

    /A& InfoTec0 Sales C0art

    -roduct5

    -roduct'

    -roduct3

    -roduct7

    PIE Chart

    /A& Infotec0 Sales C0art

    5666

    966

    5'66766

    5966

    5:9:

    5::65::5

    5::'

    5::3

    -#

  • 8/13/2019 I bsc lab programs

    20/77

  • 8/13/2019 I bsc lab programs

    21/77

    -$

  • 8/13/2019 I bsc lab programs

    22/77

    -9

  • 8/13/2019 I bsc lab programs

    23/77

    -;

  • 8/13/2019 I bsc lab programs

    24/77

    -

  • 8/13/2019 I bsc lab programs

    25/77

    ANDHRA BANK PRESENTATION

    Aim:Prepare a Presentation a)o*t Andhra 8an/ *sing M+ PowerPoint.

    Proced*re:

    tep -:tart M PowerPoint.tart Programs M PowerPoint.

    tep ':In lide - 6i"e the Title of the lide as Andhra 8an/.

    tep #:In lide ' 6i"e the title as sta)lishment and pro"ide the esta)lishment information.

    tep 3:In lides # 6i"e the title as Types of Transactions and pro"ide the information a)o*t the

    transactions.

    tep $:In lide 3 6i"e the title as a"ings and pro"ide necessary information.

    tep 9:In lide $ gi"e the Title as Ins*rance ,pport*nities and pro"ide its information.

    tep ;:In the slide 9 6i"e the title as Mediclime and pro"ide the necessary information.

    tep

  • 8/13/2019 I bsc lab programs

    26/77

  • 8/13/2019 I bsc lab programs

    27/77

    '-

  • 8/13/2019 I bsc lab programs

    28/77

    ''

  • 8/13/2019 I bsc lab programs

    29/77

    STUDENT DETAILS USING QUERIES

    Aim:Create a data)ase called t*dent *sing M ACC with at least -2 records.

    Student %arks/ield )ame

  • 8/13/2019 I bsc lab programs

    30/77

    Table data

    Qer!" d#$%la!#&' re'&() &a*e) 'e&der) t(tal *ar+$

    STUDENT DETAILS USING REPORTS

    '3

  • 8/13/2019 I bsc lab programs

    31/77

    Aim:Create a report called t*dent *sing M ACC with at least -2 records.

    Student %arks

    /ield )ame

  • 8/13/2019 I bsc lab programs

    32/77

    Re%(rt " ,#th Re' &() &a*e) *ar+$ (- all $b.e/t$ a&d t(tal

    '9

  • 8/13/2019 I bsc lab programs

    33/77

  • 8/13/2019 I bsc lab programs

    34/77

    0low Chart :

    0alse Tr*e Tr*e

    0alse Tr*e 0alse Tr*e

    0alse

    tart

    Gead

    n*m

    /2

    Jn*m

    i2//N-

    If J/ '

    rite

    UPrime

    (*m%

    rite

    U(ot

    Prime%

    top

    tart

    0or i- to

    Ji>n*m

    /2

    iiN-

    '

  • 8/13/2019 I bsc lab programs

    35/77

  • 8/13/2019 I bsc lab programs

    36/77

    REVERSE O0 A NUMBER

    Aim :To find the Ge"erse of a gi"en n*m)er.

    Algorithm :

    tep -: tart

    tep ': re"2

    tep #: Gead n

    tep 3: n*mntep 3: repeat *ntil Jn*m?2

    tep 3.-: dign*m-2

    tep 3.': re"re"Z-2Ndig

    tep 3.#: n*mn*m-2

    tep $: rite Ure"erse of the n*m)er is%1 re"tep 9: top.

    #2

  • 8/13/2019 I bsc lab programs

    37/77

    0low Chart :

    0alse Tr*e

    tart

    Gead

    n

    re"2

    J n*m?2

    rite

    Ure"erse%1re"

    toptart

    n*mn

    dign*m-2

    re"re"Z-2Ndig

    n*mn*m-2

    #-

  • 8/13/2019 I bsc lab programs

    38/77

    o*rce Code :

    Fincl*de>stdio.h?

    Fincl*de>conio.h?mainJ

    int n1n*m1dig1re"2W

    clrscrJW printfJOXn nter any n*m)er : OW

    scanfJOdO1QnW

    n*mnW whileJn*m?2

    dign*m-2W re"re"Z-2NdigW

    n*mn*m-2W

    Y printfJOXn Ge"erse of the gi"en d is :: dO1n1re"W

    getchJW

    Y

    ,*tp*t :

    nter any n*m)er : -'#

    Ge"erse of the gi"en -'# is :: #'-

    #'

  • 8/13/2019 I bsc lab programs

    39/77

    ARMSTRONG NUMBER (r NOT

    Aim :To find that whether the gi"en n*m)er is Armstrong or (ot.

    Algorithm :

    tep -: tart

    tep ': s*m2

    tep #: Gead n*m

    tep 3: d*pn*mtep 3: repeat *ntil Jn*m?2

    tep 3.-: dign*m-2

    tep 3.': s*ms*mNJdigZdigZdig

    tep 3.#: n*mn*m-2

    tep $: If Jd*ps*m then rite U n*m)er is Armstrong %

    ,therwise1

    rite U n*m)er is (ot Armstrong%

    tep 9: top.

    ##

  • 8/13/2019 I bsc lab programs

    40/77

    0low Chart :

    0alse Tr*e

    0alse Tr*e

    tart

    Gead

    n*m

    s*m2

    Jn*m?2

    d*p

    s*m

    rite

    UArmstron

    g%

    rite

    U(otArmstrong%

    toptart

    d*pn*m

    dign*m-2

    s*ms*mNdigZdigZdig

    n*mn*m-2

    #3

  • 8/13/2019 I bsc lab programs

    41/77

    o*rce Code :

    Fincl*de>stdio.h?

    Fincl*de>conio.h?mainJ

    int n*m1dig1d*p1s*m2W

    clrscrJW printfJOXn nter any n*m)er : OW

    scanfJOdO1Qn*mW

    d*pn*mW whileJn*m?2

    dign*m-2W s*ms*mNdigZdigZdigW

    n*mn*m-2W

    Y ifJd*p s*m

    printfJOXn d is an AGMTG,(6O1d*pW else

    printfJOXn d is (,T AGMTG,(6O1d*pW getchJWY

    ,*tp*t :

    nter any n*m)er : #'2

    #'2 is (,T AGMTG,(6

    nter any n*m)er : -$#

    -$# is an AGMTG,(6

    #$

  • 8/13/2019 I bsc lab programs

    42/77

    0ACTORIAL O0 A NUMBER USING RECURSION

    Aim :To find the 0actorial of a gi"en n*m)er *sing Gec*rsion.

    Algorithm :

    tep -: tarttep ': read n*m

    tep #: write U0actorial is U1 call Jfactorial Jn*mtep 3: top

    Algorithm for factorial 0*nction :

    tep -: tart

    tep ': if Jn- then1 ret*rn -

    otherwise1 tep '.-: factnZcallJfactorialJn+-

    tep '.': ret*rn fact

    #9

  • 8/13/2019 I bsc lab programs

    43/77

    0low Chart :

    factorial

    0low chart for factorial 0*nction :

    0alse Tr*e

    tart

    Gead

    n*m

    rite0actorialJn*m

    top

    0actorialJn*m

    tart

    If Jn-

    Get*rn J-

    Get*rn Jfact

    0actnZfactorialJn+

    -

    #;

  • 8/13/2019 I bsc lab programs

    44/77

    o*rce Code :

    Fincl*de>stdio.h?

    Fincl*de>conio.h?

    mainJ

    int n*mW

    clrscrJW

    printfJOXn nter any n*m)er : OW scanfJOdO1Qn*mW

    printfJOXn 0actorial of d is :: dO1n*m1factorialJn*mW

    getchJWY

    factorialJint n

    int factW

    ifJn- ret*rnJ-W

    else factnZfactorialJn+-W

    ret*rnJfactW

    Y

    ,*tp*t :

    nter any n*m)er : 9

    0actorial of 9 is :: ;'2

    #

  • 8/13/2019 I bsc lab programs

    45/77

    0UNCTION PROTOT1PE

    Aim :

    To find the 7*are of a gi"en n*m)er *sing 0*nction Prototype.

    Algorithm :

    tep -: tart

    tep ': read a

    tep #: )callJs7*areJa

    tep 3: write )

    tep $: top.

    Algorithm for s7*are 0*nction :

    tep -: tarttep ': yJ&Z&tep #: ret*rn y

    #=

  • 8/13/2019 I bsc lab programs

    46/77

    0low Chart :

    0low chart for s7*are 0*nction :

    tart

    y&Z&

    Get*rn Jy

    tart

    Gead

    a

    rite

    )

    top

    )s7*areJa

    32

  • 8/13/2019 I bsc lab programs

    47/77

  • 8/13/2019 I bsc lab programs

    48/77

    0UNCTION 2 CALL B1 RE0ERENCE

    Aim : Program to e&plain a)o*t the f*nction *sing Call )y Geference.

    Algorithm :

    tep -: tart

    tep ': a'21 )-$

    tep #: write a1 )

    tep 3: call f*nJa1)tep $: write a1)

    tep 9: top

    Algorithm for f*n 0*nction :

    tep -: tart

    tep ': y-2tep #: ret*rn

    3'

  • 8/13/2019 I bsc lab programs

    49/77

    0low Chart :

    0low chart for s7*are 0*nction :

    tart

    y-2

    Get*rn

    tart

    rite

    a1 )

    rite

    a1 )

    top

    0*n JQa1 Q)

    a'21 )-$

    3#

  • 8/13/2019 I bsc lab programs

    50/77

    o*rce Code :

    Fincl*de>stdio.h?

    Fincl*de>conio.h?"oid mainJ

    Void f*nJint Z1int ZW int a'21)-$W

    printfJOXn 8efore calling f*nction XnOW

    printfJOa d Xt ) dO1a1)W f*nJQa1Q)W

    printfJOXn After calling f*nction XnOW

    printfJOa d Xt ) dO1a1)W

    getchJWY

    "oid f*nJint Z&1int Zy

    ZW

    Zy-2W

    Y

    ,*tp*t :

    8efore calling f*nction

    a '2 ) -$

    After calling f*nction

    a #2 ) -2

    33

  • 8/13/2019 I bsc lab programs

    51/77

    SORTING USING ARRA1S

    Aim : Program for orting an array elements.

    Algorithm :

    tep -: tart

    tep ': read n

    tep #: for i2 repeat *ntil Ji>n tep #.-: Gead aSi

    tep #.': iiN-

    tep 3: for i2 repeat *ntil Ji>n

    tep 3.-: for JiN- repeat *ntil J>n

    tep 3.-.-: if JaSi?aS then tep 3.-.-.-: tempaSi

    tep 3.-.-.': aSiaS

    tep 3.-.-.#: aStemp

    tep 3.-.': N-

    tep 3.': iiN-

    tep $: for i2 repeat *ntil Ji>n

    tep $.-: rite aSi

    tep $.': iiN-

    tep 9: top

    3$

  • 8/13/2019 I bsc lab programs

    52/77

    0low Chart :

    Tr*e

    0alse

    0alse Tr*e

    Tr*e 0alse Tr*e

    0alse

    0alse

    Tr*e

    iiN-

    tart

    GeadaSi

    0or i2 to

    Ji>n

    0or JiN- to

    J>n

    If

    aSi?aS

    tempaSi

    aSiaS

    aStemp

    N-

    Geadn

    0or i2 toJi>n

    iiN-

    0or i2 to

    Ji>n

    write

    aSi

    iiN-

    top

    39

  • 8/13/2019 I bsc lab programs

    53/77

    o*rce Code :

    Fincl*de>stdio.h?

    Fincl*de>conio.h?

    mainJ

    int aS'21n1i11tempW

    clrscrJW printfJOXn nter array si!e : OW

    scanfJOdO1QnW

    printfJOXn nter array elements : OW

    forJi2Wi>nWiNNscanfJOdO1QaSiW

    forJi2Wi>nWiNN

    forJJiN-W>nWNN

    ifJaSi?aS

    tempaSiW

    aSiaSWaStempW

    Y

    Y

    Y printfJOXnXn orted array elements are : XtXnOW

    forJi2Wi>nWiNN

    printfJO$dO1aSiW getchJW

    Y

    ,*tp*t :

    nter array si!e : $

    nter array elements : -'

    9

    $#

    =

    orted array elements are :

    # $ 9 = -'

    3;

  • 8/13/2019 I bsc lab programs

    54/77

    MATRI MULTIPLICATION

    Aim : rite a program to perform Matri& M*ltiplication.

    Algorithm :

    tep -: tart

    tep ': read m1n

    tep #: if Jn[m then

    tep #.-: write Um*ltiplication is not possi)le% tep #.': goto tep m

    tep 3.-: for 2 repeat *ntil J>n

    tep 3.-.-: read aSiS tep 3.-.': N-

    tep 3.': iiN-

    tep $: for i2 repeat *ntil Ji>m

    tep $.-: for 2 repeat *ntil J>n

    tep $.-.-: read )SiS

    tep $.-.': N-

    tep $.': iiN-

    tep 9: for i2 repeat *ntil Ji>m

    tep 9.-: for 2 repeat *ntil J>n

    tep 9.-.-: cSiS2

    tep 9.-.': for /2 repeat *ntil J/>n

    tep 9.-.'.-: cSiScSiSNJaSiS/Z)S/S

    tep 9.-.'.': //N-

    tep 9.-.#: N-

    tep 9.': iiN-

    tep ;: for i2 repeat *ntil Ji>m

    tep ;.-: for 2 repeat *ntil J>n tep ;.-.-: write cSiS

    tep ;.-.': N-

    tep ;.': iiN-

    tep

  • 8/13/2019 I bsc lab programs

    55/77

    3=

  • 8/13/2019 I bsc lab programs

    56/77

    o*rce Code :

    Fincl*de>stdio.h?

    Fincl*de>conio.h?mainJ

    int aS'2S'21)S'2S'21cS'2S'21m1n1i11/W clrscrJW

    printfJOenter the order of first matri&XnOW

    scanfJOddO1Qm1QnW

    ifJn[m

    printfJOXn M*ltiplication is not possi)leOW

    goto endW Y

    printfJOenter first matri&XnOW

    forJi2Wi>mWiNN forJ2W>nWNN

    printfJOXn nter aSdSd elementsXnO1i1W scanfJOdO1QaSiSW

    Y

    printfJOenter second matri&XnOW

    forJi2Wi>mWiNN forJ2W>nWNN

    printfJOXnnter aSdSd elementsXnO1i1W scanfJOdO1Q)SiSW

    Y

    forJi2Wi>mWiNN

    forJ2W>nWNN

    cSiS2W forJ/2W/>nW/NN

    cSiScSiSNJaSiS/Z)S/SW

    Y

    Y printfJUXn M*ltiplication Matri& is :: Xn%W

    forJi2Wi>mWiNN

    forJ2W>nWNN

    printfJOdXtO1cSiSW Y

    printfJOXnOW

    $2

  • 8/13/2019 I bsc lab programs

    57/77

    Yend: getchJW

    Y

    ,*tp*t :

    nter the order of first matri&'

    '

    nter first matri&

    nter aS-S- elements'

    nter aS-S' elements'

    nter aS'S- elements'

    nter aS'S' elements'

    nter second matri&

    nter aS-S- elements'

    nter aS-S' elements'

    nter aS'S- elements'

    nter aS'S' elements'

    M*ltiplication Matri& is ::

    < stdio.h?

    Fincl*de>conio.h?Fincl*de>string.h?

    mainJ

    char strS#2W

    int len1i1cnt2W

    clrscrJW

    printfJOnter the string :: XnOW getsJstrW

    lenstrlenJstrW

    printfJOXn5I(6 05(CTI,(XnOW printfJOThe length of the string is : dXnXnO1lenW

    printfJOITH ,5T 5I(6 05(CTI,(XnOW

    forJi2WstrSi[]X2]WiNN cntNNW

    printfJO(*m)er of characters is : dO1cntW

    getchJWY

    ,*tp*t :

    nter the string ::Arts College

    5I(6 05(CTI,(The length of the string is : '-

    ITH ,5T 5I(6 05(CTI,((*m)er of characters is : -'

    $3

  • 8/13/2019 I bsc lab programs

    61/77

    COMPARISION O0 STRINGS

    Aim : To write a program to Compare two strings witho*t *sing string f*nction.

    Algorithm :

    tep -: tart

    tep ': read str-1str'

    tep #: for i2 repeat *ntil Jstr'Si[\X2\

    tep #.-: if Jstr-Sistr'Si then1

    iiN-

    otherwise1 tep #.-: write Ustrings are (ot 7*al%

    tep #.': goto step $tep 3: write Ustrings are 7*al%

    tep $: top.

    $$

  • 8/13/2019 I bsc lab programs

    62/77

    0low Chart :

    0alse Tr*e

    0alse

    Tr*e

    tart

    Gead

    tr-1 str'

    0or i2 to Jstr'Si[

    \X2\

    If

    str-Sistr'Si

    iiN-

    write

    Unot e7*al%

    writeUe7*al

    %

    top

    $9

  • 8/13/2019 I bsc lab programs

    63/77

    o*rce Code :

    Fincl*de>stdio.h?

    Fincl*de>conio.h?Fincl*de>string.h?

    "oid mainJ

    char str-S#21str'S#2W

    int iW

    printfJOXn nter first string : OW

    getsJstr-W printfJOXn nter second string : OW

    getsJstr'W

    forJi2Wstr'Si[]X2]W

    ifJstr-Sistr'Si

    iNNWelse

    printfJOXn trings are (ot e7*alOW e&itJW

    Y

    Y

    printfJOXn trings are 7*alOWY

    ,*tp*t :

    nter first string : comp*ter

    nter second string : comptter

    trings are (ot e7*al

    nter first string : this is

    nter second string : this is

    trings are 7*al

    $;

  • 8/13/2019 I bsc lab programs

    64/77

    EMPLO1EE 4 STRUCTURE

    Aim : To write a program to create employee details *sing str*ct*re.

    Algorithm :

    tep -: tart

    tep ': read n

    tep #: for i2 repeat *ntil Ji>n

    tep #.-: read empSi.eno1 empSi.name1 empSi.age

    tep #.': iiN-

    tep 3: for i

    2 repeat *ntil Ji>n tep 3.-: write empSi.eno1 empSi.name1 empSi.age

    tep 3.': iiN-tep $: top.

    $

  • 8/13/2019 I bsc lab programs

    65/77

    0low Chart :

    0alse Tr*e

    Tr*e

    tart

    Gead

    n

    0or i2 to Ji>n

    iiN-

    Gead

    empSi.eno1empSi.name

    empSi.age

    0or i2 to Ji>n

    iiN-

    rite

    empSi.eno1empSi.name

    empSi.age

    top

    $=

  • 8/13/2019 I bsc lab programs

    66/77

    o*rce Code :

    Fincl*de>stdio.h?Fincl*de>conio.h?

    str*ct employee

    int enoW

    char nameS'2W

    int ageW

    YW

    mainJ

    str*ct employee empS-2W

    int n1iW

    clrscrJW printfJOXn nter the n*m)er of employee: OW

    scanfJOdO1QnW

    forJi2Wi>nWiNN

    printfJOXn enter empno1empname1age for employee dXnO1iW

    scanfJOdsdO1QempSi.eno1empSi.name1QempSi.ageW

    Y printfJOXn the company]s employee profile is as follows:XnOW

    forJi2Wi>nWiNN

    printfJOXn employee d]s dataXn dXtsXtdXnO1i1empSi.eno1empSi.name1empSi.ageW

    Y

    getchJWY

    92

  • 8/13/2019 I bsc lab programs

    67/77

    ,*tp*t :

    nter the n*m)er of employee: '

    enter empno1empname1age for employee --2-

    ra*

    #3

    enter empno1empname1age for employee '

    -2'

    ram*#$

    The company]s employee profile is as follows:

    employee -]s data

    -2- ra* #3

    employee ']s data

    -2' ram* #$

    9-

  • 8/13/2019 I bsc lab programs

    68/77

    ARRA1 ELEMENTS USING POINTERS

    Aim :To write a program to access the array elements thro*gh pointer.

    Algorithm :

    tep -: tart

    tep ': pa

    tep #: read n

    tep 3: for i2 repeat *ntil Ji>n

    tep 3.-: read JpNi tep 3.': iiN-

    tep $: for i2 repeat *ntil Ji>n tep $.-: write ZJpNi

    tep $.': iiN-

    tep 9: top

    9'

  • 8/13/2019 I bsc lab programs

    69/77

    0low Chart :

    0alse Tr*e

    Tr*e

    0alse

    tart

    Geadn

    pa

    GeadpNi

    0or i2 to

    Ji>n

    iiN-0or i2 to

    Ji>n

    riteZJpNi

    iiN-

    top

    9#

  • 8/13/2019 I bsc lab programs

    70/77

    o*rce Code :

    Fincl*de>stdio.h?

    Fincl*de>conio.h?

    "oid mainJ

    int aS'21i1Zp1nW

    paW

    printfJOXn nter array si!e : OW scanfJOdO1QnW

    printfJOnter array elements : XnOW

    forJi2Wi>nWiNNscanfJOdO1pNiW

    printfJOXnXn Array elements are : XnOW

    forJi2Wi>nWiNNprintfJOdXtO1ZJpNiW

    Y

    ,*tp*t :

    nter array si!e : $

    nter array elements :9$#'

    -2

    '2

  • 8/13/2019 I bsc lab programs

    71/77

    STRUCTURE ELEMENTS USING POINTERS

    Aim :To write a program to access the str*ct*re elements thro*gh pointer.

    Algorithm :

    tep -: tart

    tep ': read st*name1st*rollno1st*m-1st*m'1st*m#

    tep #: st*totst*m-Nst*m'Nst*m#

    tep 3: st*

    a"g

    st*

    tot#tep $: write st*name1st*rollno1st*tot1st*a"g

    tep 9: top

    9$

  • 8/13/2019 I bsc lab programs

    72/77

    0low Chart :

    tart

    Gead

    st*name1st*rolln

    o

    st*m-1st*m'

    st*m#

    st*totst*m-Nst*m'Nst*m#

    st*a"gst*tot#

    write

    st*name1st*rollno

    st*tot1st*a"g

    top

    99

  • 8/13/2019 I bsc lab programs

    73/77

    o*rce Code :

    Fincl*de>stdio.h?

    Fincl*de>conio.h?

    str*ct st*dent

    char nameS#2W

    int rollno1m-1m'1m#1totW

    float a"gWYW

    "oid mainJ

    str*ct st*dent Zst*W

    printfJOXn nter st*dent record as name1rollno Q # s*) mar/s : OW

    getsJst*+?nameW scanfJOddddO1Qst*+?rollno1Qst*+?m-1Qst*+?m'1Qst*+?m#W

    st*+?totst*+?m-Nst*+?m'Nst*+?m#W

    st*+?a"gst*+?tot#W printfJOXnXn The st*dent record is :: XnOW

    printfJOXn (ame OW

    p*tsJst*+?nameW

    printfJOGollno dXntotal dXnA"erage fO1st*+?rollno1st*+?tot1st*+?a"gW getchJW

    Y

    ,*tp*t :

    nter st*dent record as name1rollno Q # s*) mar/s : an*sha

    --'3

    '$

    '#

    The st*dent record is ::

    (ame an*sha

    Gollno --

    total ;'

    A"erage 3.222222

    9;

  • 8/13/2019 I bsc lab programs

    74/77

    0ILES

    Aim :

    9

  • 8/13/2019 I bsc lab programs

    75/77

    9=

  • 8/13/2019 I bsc lab programs

    76/77

    Fincl*de>stdio.h?Fincl*de>conio.h?

    mainJ

    0IL Zf-1Zf'1Zf#W

    int i1nW

    clrscrJW

    f-fopenJOInp*tO1OwOW printfJOXn nter the contents of a fileXnOW

    forJi-Wi>-2WiNN

    scanfJOdO1QnW

    p*twJn1f-W Y fcloseJf-W

    f-fopenJOInp*tO1OrOW

    f'fopenJO"enO1OwOW

    f#fopenJO,ddO1OwOW whileJJngetwJf-[,0

    ifJJn'2 p*twJn1f'W

    else

    p*twJn1f#W Y

    fcloseJf-W

    fcloseJf'W

    fcloseJf#W f-fopenJOInp*tO1OrOW

    printfJOXnContents of first file XnOW

    whileJJngetwJf-[,0

    printfJOdXtO1nW

    Y

    fcloseJf-W f'fopenJO"enO1OrOW

    printfJOXn Contents of e"en fileXnOW whileJJngetwJf'[,0

    printfJOdXtO1nW

    Y fcloseJf'W

    f#fopenJO,ddO1OrOW

    ;2

  • 8/13/2019 I bsc lab programs

    77/77

    printfJOXnContents of oddfile XnOW whileJJngetwJf#[,0

    printfJOdXtO1nW Y

    fcloseJf#W

    getchJW Y

    nter the contents of a file-'

    3

    #9

    ;