Width Band

Embed Size (px)

Citation preview

  • 8/9/2019 Width Band

    1/33

    DATE:27/11/2014

    NO:29

    AIM:write a program that demonstrates inpt otpt streams and !n"tions

    #include

    #include

    #include

    #include

    void main()

    {

    char c,st[20];

    clrscr();

    cout

  • 8/9/2019 Width Band

    2/33

    cout.ill(343);

    cout

  • 8/9/2019 Width Band

    3/33

    DATE:27/11/2014

    NO:%0

    AIM: write a program that ses o&'e"t !or string manip(ation !n"tion

    #include

    using namesace std;

    int main()

    {

    string s;

    string s2(%e);

    string s1(elhi);

    ss2;

    cout

  • 8/9/2019 Width Band

    4/33

    cin>>s=;

    cout

  • 8/9/2019 Width Band

    5/33

    cout

  • 8/9/2019 Width Band

    6/33

    cout

  • 8/9/2019 Width Band

    7/33

    %o the second string is %%elhi

    o ne strings are created'F+ and GHI

    *irst is not eKual to second

    econd is greater than irst

    *irst < econd

    iMe o irst string is 1

    Nength o irst string is 1

    F+ is ound at

    + is ound at 2

    Feore saing 'F+GHI

    'ter saing GHI'F+

    DATE:2)/11/2014

    NO:%1

    AIM:De!ine and o*er(oad !n"tion temp(ates to sear"h an item in an arra+

    #include

    #include

    void ser(int,int);

    ??void ser(loat,loat,int);

    void linear(int,int);

    temlate

    ??temlate

    void ser( a[],int n)

    {

  • 8/9/2019 Width Band

    8/33

    int i,B,mi,os,0,lb,ub,P;

    coutP;

    lb0;

    ubn;

    or(ilb;i

  • 8/9/2019 Width Band

    9/33

    8

    i() cout

  • 8/9/2019 Width Band

    10/33

    void main()

    {

    int a[0];

    loat b[0];??{,2,1,=,E8;

    ??a;

    int n,i,P;

    loat h;

    clrscr();

    coutn;

    cout

  • 8/9/2019 Width Band

    11/33

    ser(b,h,n); 4?

    cout

  • 8/9/2019 Width Band

    12/33

    O#T$#T

  • 8/9/2019 Width Band

    13/33

  • 8/9/2019 Width Band

    14/33

    DATE:01/12/2014

    NO:%%

    AIM:reate to !i(es !irst and se"ond- tore tet in!ormation in the !irst !i(e and

    "op+ the "ontents o! the !irst !i(e to se"ond !i(e in re*erse order-

  • 8/9/2019 Width Band

    15/33

    O#T$#T

  • 8/9/2019 Width Band

    16/33

  • 8/9/2019 Width Band

    17/33

    cout

  • 8/9/2019 Width Band

    18/33

    cout

  • 8/9/2019 Width Band

    19/33

    case E/ cout

  • 8/9/2019 Width Band

    20/33

    {

    istream iile;

    iile.oen(em, ios//in Q ios//binarA);

    emloAee e;

    iile.seePg(0);

    cout

  • 8/9/2019 Width Band

    21/33

    e.getdata();

    ioile.rite((char 4) R e, siMeo e);

    cout

  • 8/9/2019 Width Band

    22/33

    2.close();

    remove(em);

    rename(em,em);

    cout

  • 8/9/2019 Width Band

    23/33

    1. @odiA

    =. elete

    E. earch

    5. Lit

    nter Aour choice

    2

    he records are

    he details are

    sonu

    E000

    @ain @enu

    . 'dd

    2. ho

    1. @odiA

    =. elete

    E. earch

    5. Lit

    nter Aour choice

    1

    otal number o records

    nter the number o record to be udated

  • 8/9/2019 Width Band

    24/33

    nter ne values or this record

    mloAee details

    %umber, %ame, alarA

    ashoP 1000

    @odiied

    @ain @enu

    . 'dd

    2. ho

    1. @odiA

    =. elete

    E. earch

    5. Lit

    nter Aour choice

    2

    he records are

    he details are

    ashoPh

    1000

    @ain @enu

    . 'dd

    2. ho

    1. @odiA

  • 8/9/2019 Width Band

    25/33

    =. elete

    E. earch

    5. Lit

    nter Aour choice

    =

    nter the emloAee number to be deleted

    he record is successullA deleted

    @ain @enu

    . 'dd

    2. ho

    1. @odiA

    =. elete

    E. earch

    5. Lit

    nter Aour choice

    enter the data to be added?aended

    mloAee details

    %umber, %ame, alarA

    2 manBu 1000

    he record is added

    @ain @enu

  • 8/9/2019 Width Band

    26/33

    . 'dd

    2. ho

    1. @odiA

    =. elete

    E. earch

    5. Lit

    nter Aour choice

    E

    nter the emloAee number to be searched

    2

    he details are

    2

    manBu

    1000

    @ain @enu

    . 'dd

    2. ho

    1. @odiA

    =. elete

    E. earch

    5. Lit

    nter Aour choice

    5

  • 8/9/2019 Width Band

    27/33

    erminating Crogram

    DATE:0%/12/2014

    NO:%

    AIM: pgm to enter nm&ers in an integer arra+- disp(a+ the (argest nm&er- i!

    the arra+ "ontains n(( e(ement. throw the e"eption-

    #include

    using namesace std;

    class eL

    {

    int maL[E];

    ublic/

    void getn()

    {

    maL[0];maL[]0;

    maL[2]1;

    maL[1]=;

    maL[=]E;

    8

    void largest()

    {

    int larmaL[0];

    or (int i0;i

  • 8/9/2019 Width Band

    28/33

    thro i;

    else

    i(lar

  • 8/9/2019 Width Band

    29/33

    the arraA is

    0

    1=

    E

    +aught a null value

    DATE:0%/12/2014

    NO:%5

    AIM: Inpt 2 two digit positi*e nm&ers and disp(a+ the prime

    nm&ers in &etween them

    possi&(e errors

    1-no- o! digits is 2

    2-n26n1

    %-"he", negati*e *a(e !or an operand

    4- range n1 and 6n2

    -n1 and n2 mst not &e same

    #include

    using namesace std;

    class number

    {

    int n,n2;

    ublic/

  • 8/9/2019 Width Band

    30/33

    class checPOnumber{8;

    class checPOnegative{8;

    class checPOlarge{8;

    class checPOrange{8;

    class checPOsame{8;

    number()

    { 8

    number(int L,int A)

    {

    i (L

  • 8/9/2019 Width Band

    31/33

    {

    cout

  • 8/9/2019 Width Band

    32/33

    {

    number n(0,20);

    n.rime();

    8

    catch(number// checPOnumber)

    {

    cout

  • 8/9/2019 Width Band

    33/33

    {

    cout