Top Banner

of 71

CP RECORD

Apr 14, 2018

Download

Documents

Krish Krishna
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
  • 7/30/2019 CP RECORD

    1/71

    MICROSOFT

    WORD

  • 7/30/2019 CP RECORD

    2/71

    Ex.No:1a

    Date: CREATING ADVERTISEMENT

    AIM:

    To prepare an advertisement for a company with some specifications.

    Attractive page border.

    Use at least one Clip Art.

    Design name using Word Art.

    Use bullets.

    ALGORITHM:

    Step 1: Open a blank document.

    Step 2: Go to Page LayoutPage BordersSelect Attractive Page BorderOk

    Step 3: Go to InsertClip ArtSelect Attractive Clip ArtOk.

    Step 4: Type a name and selectgo to insertWord ArtSelect a Word Art & click

    Step 5: Type a brief company details & Right Click

    Select the Bullets

    Ok.

    Step 6: Save the document.

  • 7/30/2019 CP RECORD

    3/71

    OUTPUT:-

    Facilities:

    * Separate hostels for bothboys and girls

    * Skilled faculties * Bus facilities

    * Wifi facilities inside college * Mess * Ragging freecampus

    RESULT:-

    Thus the advertisement has been created with some specifications in Microsoft

    word successfully and verified.

    CK College of Engineering &

    Technology

    Address: Jayaram Nagar,Chellangkuppam,Cuddalore 607

    003Contact No: +914142217777

    Courses Offered:

    Engineering(BE/B Tech)Civil Engineering

    Electronics and communication

    Electrical and electronics

    Computer Science

    Mechanical Engineering

    Management StudiesMaster of business management

    NO

    DONATI

    ON

  • 7/30/2019 CP RECORD

    4/71

    Ex.No:1b

    Date: CURRICULUM VITAE

    AIM:

    To create curriculum vitae (CV) of a B.E graduate with the specification.

    Table to show qualifications with heading.

    Left & Right margins

    Page numbers in the footer on the right side.

    Use Watermark.

    ALGORITHM:

    Step 1: Open a blank document.

    Step 2: Type a Bio-data briefly then goto InsertTableInsertTableSelect

    no of rows & columnsOk for qualifications.

    Step 3: Go to Page LayoutMarginsAssignLeft & Right Margins

    Step 4: Go to InsertPage NumbersSelect footer on the right sideOk.

    Step 5: Go to Page LayoutWatermarkCustomize text as Bio-dataOk.

    Step 6: Save the Document.

  • 7/30/2019 CP RECORD

    5/71

    OUTPUT:-

    VIJAYA. AADDRESS:NO:15 SANTHOME STREET,

    EAST MAMBALAM,CHENNAI ,

    TAMIL NADU.MOBILE: +919804111778E-mail: [email protected]

    OBJECTIVE:

    To be associated with a progressive organization that provides an opportunity to apply my

    knowledge and skills in order to keep in touch with latest trends and technologies.

    QUALIFICATIONS:

    Degree School/ Institution Board/University Year of

    Passing

    Percentage of

    marks obtained

    BE(CSE) ARM CET Anna university 2011 87

    HSC Bharath vidhya manthir CBSC 2007 91

    SSLC Bharath vidhya manthir CBSC 2005 90

    TECHNICAL SKILLS:

    Networking : Basic of Switch,hub, Bridge, Router and Wireless networking .

    Operating System : Windows XP, windows 7

    Troubleshooting : Windows XP, windows 7Software Installation : OS (Windows XP, windows 7)

    PERSONAL DETAILS:

    Nationality : IndianGender : Male

    Date of Birth : 11- May-1989

    Status : Unmarried

    Permanent Address : Sirukalathur post, S en dh ur i TK , TamilNadu India.Languages known : Tamil, English

    Interests and Activities : Listening to music, Watching cricket, Riding bikes

    DECLARATION

    I hereby declare that all the details furnished above, are genuine to the best of my knowledge.

    Place : Chennai Signature

    Date : 25/11/2011

  • 7/30/2019 CP RECORD

    6/71

    (Vijaya.A)

    RESULT:-

    Thus the curriculum vitae (CV) has been created with some specifications in

    Microsoft word successfully and verified.

    Ex.No:1c

    Date: SCIENTIFIC NOTATIONS

    AIM:

    To create a MS-WORD document for the following scientific notation

    i. A= + + +

    ii.+

    iii.

    iv.

    v.+ 7 4 + 6 o

    ALGORITHM:

    Step 1: Open a blank document.

    Step 2: Go to InsertEquationInsert EquationSelect the specific format.

    For eg , for , ..

  • 7/30/2019 CP RECORD

    7/71

    Step 3: Select for

    Step 4: Select for

    Step 5: Save the document.

  • 7/30/2019 CP RECORD

    8/71

    OUTPUT:-

    1. A = a2

    0 +a3

    1+b

    2

    0 +b4_

    1

    2. x1

    y1

    +x 22

    2)2(

    yx

    y

    +

    +

    3. x =a

    acbb

    2

    42

    4. T ( )m = ==m

    i

    m

    jxijtijcij ..;1.1

    5. OHgCOgOgHC 22222 6)(4)(7)(2 ++

    RESULT:-

    Thus the scientific notations has been created in Microsoft word successfully

    and verified.

  • 7/30/2019 CP RECORD

    9/71

    Ex.No:2

    Date: CREATING TIME TABLE & CONVERSION

    AIM:

    To prepare a class timetable using Merge rows, Split row, Insert rows - columns

    etc and convert the table into text format.

    ALGORITHM:

    Step1: Open a blank document.

    Step 2: InsertTableInsert TableSelect No of rows & columnsOk.

    Step 3: Select two cells Right clickMerge Cells.

    Select one cell Right clickSplit Cell

    Select one row Right clickInsertInsert One row above or below

    Select one column Right clickInsertInsert One column left or right

    Step 4: Type a Class Timetable with Headings

    Step 5: Go to LayoutConvert to textSelect Tabs Ok

    Step 6: Save the document as Table and Text Format

  • 7/30/2019 CP RECORD

    10/71

    OUTPUT:-

    RESULT:-

    Thus the class time table has been created & table is converted into text in

    Microsoft word successfully and verified.

  • 7/30/2019 CP RECORD

    11/71

    Ex.No:3a

    Date: MAIL MERGE & LETTER PREPARATION

    AIM:-

    To create a WORD document to call letters for an interview using Mail Merge

    send to10 candidates

    ALGORITHM:-

    STEP 1: Open a blank document

    STEP 2:Goto Mailings in Menu Start Mail merge Letters

    STEP 3: Type a interview call letter with FROM address and leave some

    Space for TO address

    STEP 4:GotoSelect recipients Type a new listCustomize the

    Columns Ok

    STEP 5: Type a 10 address new some fieldsOksave it

    STEP 6:GotoSelect recipients Use Existing listopen a fileOk

    STEP 7: Under the TO Address insert the Merge fields & preview the results

    STEP 8:Goto Finish MergeEdit individual Documents AllOk

    STEP 9: Save the document

  • 7/30/2019 CP RECORD

    12/71

    OUTPUT:

    RESULT:-

    Thus the Mail Merge has been created in Microsoft word successfully and Verified.

  • 7/30/2019 CP RECORD

    13/71

    Ex.No:4

    Date: DRAWING FLOW CHART

    AIM:-

    To create a flowchart in WORD to find the greatest of three numbers

    ALGORITHM:-

    STEP 1: Open a blank document

    STEP 2:Goto Insert shapesFlowchart

    STEP 3: Insert the Correct shapes for Input box decision box ,Calculation

    box and Output box

    STEP 4: Select the box and Right Click Add Text

    STEP 5: Use Arrows for Link

    STEP 6: Save the document

  • 7/30/2019 CP RECORD

    14/71

    OUTPUT:-

    RESULT:-

    Thus the flowchart in WORD to find the greatest of three numbers has been

    created in Microsoft word successfully and verified.

  • 7/30/2019 CP RECORD

    15/71

    MICROSOFT

    EXCEL

  • 7/30/2019 CP RECORD

    16/71

  • 7/30/2019 CP RECORD

    17/71

  • 7/30/2019 CP RECORD

    18/71

  • 7/30/2019 CP RECORD

    19/71

  • 7/30/2019 CP RECORD

    20/71

  • 7/30/2019 CP RECORD

    21/71

  • 7/30/2019 CP RECORD

    22/71

    Ex.No:8

    Date:

    SPREAD SHEET SORTING & IMPORT /EXPORTFEATURES

    AIM:-

    To create a spreadsheet to sort the names and sort the numbers and convert the

    numbers

    Decimal numbers:- 243,46,173,425,625

    Binary numbers:-11011, 1110110101, 11001, 11111

    ALGORITHM:-

    STEP 1: Open a Microsoft Excel Worksheet.

    STEP 2: Type some list of names in randomly

    STEP 3:Select the names and Right click SortSelect the names and sort

    In Ascending Order ( A to Z)

    STEP 4:Select the numbers and Right click SortSelect the numbers and

    sort In Ascending Order ( Small to Large)

    STEP 5:For Conversion Goto FormulaSelect More

    FunctionsEngineeringSelect DEC2BIN, DEC2HEX,DEC2OCT

    and BIN2DEC,BIN2HEX,BIN2OCT etc

    STEP 6: Save the ExcelSheet

  • 7/30/2019 CP RECORD

    23/71

  • 7/30/2019 CP RECORD

    24/71

  • 7/30/2019 CP RECORD

    25/71

  • 7/30/2019 CP RECORD

    26/71

    AREA AND CIRCUMFERENCE OF THE CIRCLE

    AIM:-

    To write a C program to find the area and circumference of the circle

    ALGORITHM:-

    STEP 1: Start the Program

    STEP 2: Input the radius of the Circle.

    STEP 3: Find the area and circumference of the circle using the formula

    Area =3.14*r*r

    Circum=2*3.14*rSTEP 4: Print the area and Circumference

    STEP 5: Stop the Program

    FLOW CHART:-

    Stop

    Print

    Area,Circum

    Start

    Read Radius

    Area =3.14*r*r

    Circum=2*3.14*r

  • 7/30/2019 CP RECORD

    27/71

  • 7/30/2019 CP RECORD

    28/71

    5

    Area=78.500000

    Circumference=31.400000

    SWAPPING OF TWO NUMBERS

    AIM:-

    Write a C program to swap the variable using another variable.

    ALGORITHM:-

    STEP 1: Start the Program

    STEP 2: Read the value of a,b.

    STEP 3: To swap using another variable

    STEP 3.1 t=a;

    STEP 3.2 a=b;

    STEP 3.2 b=t;STEP 4: Print the value of a and b

    STEP 5: Stop the Program

    FLOW CHART:-

    Start

    Stop

    Read a, b

    t = a;

    a = b;

    b = t;

    Print a,b

  • 7/30/2019 CP RECORD

    29/71

  • 7/30/2019 CP RECORD

    30/71

    After swapping : A= 36 B=24

    QUADRATICEQUATION

    AIM:-

    To write a C program to find the roots of the quadratic equation

    ALGORITHM:

    STEP 1: Start the program.

    STEP 2: Enter the value of a,b,c.

    STEP 3: Find the value of d by using the formula d=b*b-4*a*c

    STEP 4: If d is greater then or equal to zero then find the two roots as

    r1=(-b+sqrt(d))/(2*a)

    r1=(-b+sqrt(d))/(2*a)

    Print the two roots

    STEP 5: If the d is not greater then or equal to zero then print the statement the roots are imaginary.

    STEP 6: Stop

    FLOWCHART

    Start

    Read

    a,b,c

    d=b*b-4*a*c

    r1=(-b+sqrt(d))/(2*a)

    r1=(-b+sqrt(d))/(2*a)

    sum=sum+a

    Print the

    roots are

    imaginary

    Stop

    is

    d>=0

  • 7/30/2019 CP RECORD

    31/71

  • 7/30/2019 CP RECORD

    32/71

  • 7/30/2019 CP RECORD

    33/71

    PROGRAM:

    //ODD OR EVEN

    #include

    #include

    void main()

    {

    int num;

    clrscr();

    printf("Enter a number");

    scanf("%d",&num);

    if(num%2==0)

    {

    printf("The given number is Even");

    }

    else

    printf("The given number is Odd");

    getch();}

    OUTPUT:

  • 7/30/2019 CP RECORD

    34/71

    Enter a number

    2

    The given number is Even

    Enter a number

    47The given number is Odd

    PRIME NUMBER ARE NOT

    AIM

    Develop a c program to find out the prime number.

    ALGORITHM

    STEP-1: Start the program

    STEP-2: I2

    STEP-3: Read num

    STEP-4: Is i

  • 7/30/2019 CP RECORD

    35/71

  • 7/30/2019 CP RECORD

    36/71

    }

    OUTPUT:

    ENTER THE NUMBER

    3THE GIVEN NUMBER IS A PRIME

    ENTER THE NUMBER4

    THE GIVEN NUMBER IS NOT A PRIME NUMBER.

    PALINDROME

    AIM:-

    To write a C program to find the sum & reverse of digits and Check is Palindrome or not

    ALGORITHM:-

    STEP 1: Start the program.

    STEP 2: Enter the number.

    STEP 3: Set a loop upto the number is not equal to zero .

    Remnum%10 SumSum+rem Rnum rnum *10 +rem Num num/10

    STEP 4: After the end of the loop print the sum and reverse no of the digit.

    STEP 5: Find whethwe the reverse no is equal then is palindrome or not

    STEP 6: Stop the Program.

    FLOWCHART

    No

    YesPrint is not

    Palindrome

    Read n

    t=n

    Is t>0

    r=r*10+t%10;

    t=t/10;

    Stop

    Start

    Is n=r

    Print

    Palindrome

  • 7/30/2019 CP RECORD

    37/71

    No

    Yes

    PROGRAM:

    // PALINDROME

    #include

    #include

    void main()

    {

    long int n,t,r=0;

    clrscr();

    printf("Enter the number\n\n");

    scanf("%ld",&n);

    t=n;

    while(t>0)

    {

    r=r*10+t%10;

    t=t/10;

    }

    if(n==r)

    printf("\nThe given number is a palindrome");

    else

    printf("\nThe given number is not a palindrome");

    getch();

    }

  • 7/30/2019 CP RECORD

    38/71

    OUTPUT:

    Enter the number

    2332

    The given number is a palindrome

    FACTORIAL NUMBER

    AIM:-

    To write a program to calculate the factorial of the given number using functions.

    ALGORITHM:

    STEP 1: Start the program.

    STEP 2: Enter a number.

    STEP 3: Set a loop to find the factorial of the given no using Fact=fact*i

    STEP 4: Print the factorial of the given number.

    STEP 5: Stop the program.

    FLOWCHART

    No

    Start

    Read n

    i1

    Fact=fact*i

    Print fact

    Stop

    Is

    i

  • 7/30/2019 CP RECORD

    39/71

  • 7/30/2019 CP RECORD

    40/71

    FIBONACCI NUMBER

    AIM:-

    To write a program to find the Fibonacci series of the given number

    ALGORITHM:-

    STEP 1: Start the program.

    STEP 2: Enter the number.

    STEP 3: Check the number whether the number is zero or not.

    If zero print zero value.If not zero go further.

    STEP 4: Set a loop upto the given number.

    STEP 5: fib=fib+a; a=b; b=c;

    STEP 6: Every increment in the loop prints the value of fib.

    STEP 7: After the execution of the loop stops the program.

    FLOWCHART

    No

    Start

    Read

    num

    i=0

    Is

    num=n

    Is

    i

  • 7/30/2019 CP RECORD

    41/71

  • 7/30/2019 CP RECORD

    42/71

    getch();

    }

    OUTPUT:

    Enter the Number: 7

    FIBBONACI SERIES: 0 1 1 2 3 5 8

    MENU DRIVEN CALCULATOR

    AIM:-

    To write a simple menu driven calculator program using switch statement.

    ALGORITHM:-

    STEP 1: Start the program

    STEP 2: Display Menu

    STEP 3: Read the two variable a and b

    STEP 4: Enter the option code

    STEP 5: Evaluate option code with case constants

    STEP 5.1 Case = 1

    c=a+b

    Print c.

    Goto Step-7

    STEP 5.2 Case = 2

    c=a-b

    Print c.

    Goto Step-7

    STEP 5.3 Case = 3

    c=a*b

    Print c.

    Goto Step-7

    STEP 5.4 Case = 4

    c=a/b

  • 7/30/2019 CP RECORD

    43/71

  • 7/30/2019 CP RECORD

    44/71

    PROGRAM:

    //MENU DRIVEN CALCULATOR

    #include

    #includevoid main()

    {

    int a,b,c,n;

    clrscr();

    printf( --MENU--\n);

    printf(1 ADDITION\n);

    printf(2 SUBTRACTION\n);

    printf(3 MULTIPLICATION\n);

    printf(4 DIVISION\n);

    printf(0 EXIT\n);

    printf(Enter your choice : );

    scanf(%d,&n);

    if(n0)

    {

    printf(Enter two numbers : );

    scanf(%d %d, &a,&b);

    }

    switch(n)

    {

  • 7/30/2019 CP RECORD

    45/71

  • 7/30/2019 CP RECORD

    46/71

    OUTPUT:

    --MENU

    1 ADDITION

    2 SUBTRACTION

    3 MULTIPLICATION

    4 DIVISION

    0 EXIT

    Enter your choice : 1

    Enter two numbers: 8 6

    Addition : 14

    --MENU

    1 ADDITION

    2 SUBTRACTION

    3 MULTIPLICATION

    4 DIVISION

    0 EXIT

    Enter your choice : 2

  • 7/30/2019 CP RECORD

    47/71

  • 7/30/2019 CP RECORD

    48/71

    FLOWCHART:

    Read n

    Start

    Small=a[0]Large=a[0]

    For i=0;ilarg

    e

    Small=a[i] Large=a[i]

    Print

    large,

    small

    Start

  • 7/30/2019 CP RECORD

    49/71

    PROGRAM:

    //FINDING LARGEST AND SMALLEST

    #include

    #include

    void main()

    {

    int n,i,a[50],small,large;

    clrscr();

    printf ("\n enter the no.of element in the array...\n");

    scanf("%d",&n);

    printf("\n enter the numbers one by one...\n");

    for(i=0;i

  • 7/30/2019 CP RECORD

    50/71

    }

    OUTPUT:

    Enter the no. of element in the array...

    5

    Enter the numbers one by one...

    12

    323

    453

    554

    2

    Largest among the given 5 number is: 554

    Smallest among the given 5 number is: 2

  • 7/30/2019 CP RECORD

    51/71

    ASCENDING AND DESCENDING ORDER

    AIM:-

    To write a program to print the ascending and descending order of the given array..

    ALGORITHM:-

    STEP 1: Start the program

    STEP 2: Enter the size of the array

    STEP 3: Enter the elements of the array

    STEP 4: Set a loop up to the array size minus one

    STEP 5: Set a inner loop up to the size of the array

    STEP 6: Check whether the next array elements is greater than or not

    STEP 7: If greater than exchange their position

    STEP-8: If not greater than then go to the loop

    STEP-9: After the execution of the inner loop the outer loop is executed

    Step-10: Print the ascending order of the given array

    Step-11: Print the descending order of the given array

    Step-12: Stop

  • 7/30/2019 CP RECORD

    52/71

    FLOCHART

    Read no

    a=num[i]num[i]=num[j]

    num[j]=a

    For i=0;i

  • 7/30/2019 CP RECORD

    53/71

    PROGRAM:

    //ASCENDING AND DESCENDING ORDER

    #include

    #include

    void main()

    {

    int num[100],no,i,j,a;

    clrscr();

    printf("Enter the no. of terms...");

    scanf("%d",&no);

    printf("enter the number");

    for(i=0;i

  • 7/30/2019 CP RECORD

    54/71

    printf("\n The ascending order of the given numbers ");

    for(i=0;i=0;j--)

    printf("\n %d",num[j]);getch();

    }

    OUTPUT:

    Enter the no. of terms ...3

    enter the number

    23

    12

    34

    The ascending order of the given numbers

    34

    23

    12

    The descending number of the given numbers

    12

    23

    34

  • 7/30/2019 CP RECORD

    55/71

    REVERSE THE ELEMENT OF THE ARRAY

    AIM

    To write a C program to reverse the elements given in an array.

    ALGORITHM:

    STEP-1 Start

    STEP-2 Read the value of n

    STEP-3 Assign i=0

    STEP-4 Repeat the steps 5 & 6 until i=n

    STEP-5 Read a[i]

    STEP-6 Compute i=i+1

    STEP-7 Assign i=n-1

    STEP-8 Repeat the steps 9 and 10 until i>=0

    STEP-9 Print a[i]

    STEP-10 Compute i=i-1

    STEP-11 Stop

    FLOWCHART:

    Read n

    Start

    For i=0;i=0;i--

    Print a[i]

    Stop

  • 7/30/2019 CP RECORD

    56/71

    PROGRAM:

    //REVERSE OF THE GIVEN ARRAY

    #include

    #include

    void main()

    {

    int n,i,a[50];

    clrscr();

    printf("\n Enter the no. of element in the array...\n");

    scanf("%d",&n);

    printf("\n Enter the array element one by one...\n");

    for(i=0;i=0;i--)

    printf("\n%d",a[i]);

    getch();}

  • 7/30/2019 CP RECORD

    57/71

    OUTPUT:

    enter the no. of element in the array...

    5

    Enter the array element one by one...

    1

    2

    3

    4

    5

    Reverse of array elements are ...

    5

    4

    3

    2

    1

  • 7/30/2019 CP RECORD

    58/71

    MATRIX MULTIPLICATION

    AIM:-

    To write a C program to perform Matrix Multiplication.

    ALGORITHM:-

    STEP 1: Start the program.

    STEP 2: Enter the row and column of the A matrix.

    STEP 3: Enter the elements of the A matrix.

    STEP 4: Enter the row and column of the B matrix.

    STEP 5: Enter the elements of the B matrix.

    STEP 6: Set a loop up to row.

    STEP 7: Set a inner loop up to column.

    STEP 8: Set another inner loop up to column.

    STEP 9: Add the elements of A and B in column wise and store the result in c matrix..

    STEP 10: After the execution of two loops. Print the value of C matrix

    STEP 11: Stop the program.

  • 7/30/2019 CP RECORD

    59/71

    FLOCHART:

    Readr1,c1

    C[i][j]=a[i][j]+b[i][j]

    Start

    For i=0;i

  • 7/30/2019 CP RECORD

    60/71

    PROGRAM:

    //MATRIX ADDITION

    #include

    #include

    void main()

    {

    int i,j,k,c1,r1,c2,r2,c3,r3;

    int a[5][5],b[5][5],c[5][5],d[5][5];

    clrscr();

    printf("\n Enter the order of the matrix a....\n");

    scanf("%d %d",&r1,&c1);

    printf("\n Enter the elements of the matrix a\n");

    for (i=0;i

  • 7/30/2019 CP RECORD

    61/71

    scanf("%d",&b[i][j]);

    }

    }

    printf("\n Addition of two matrix\n");

    for(i=0;i

  • 7/30/2019 CP RECORD

    62/71

    MARKSHEET OF STUDENTS USING STRUCTURES

    AIM:- To write a C program to print the mark sheet of n students using structures.

    ALGORITHM:-

    STEP 1: Start the program.

    STEP 2: Struct std

    Rno,marks:integer

    Name[10]:character

    End Struct

    STEP 3: Read total number of students n.

    STEP 4: Read s[i].rno.s[i].name,s[i].marks

    STEP 5: Print s[i].rno,s[i].name,s[i].marks

    STEP 6: Stop the program.

    FLOWCHART:

    Start

    Read n

    For i=0;i

  • 7/30/2019 CP RECORD

    63/71

    PROGRAM:

    #include

    #include

    struct stud

    {

    int rno;

    char name[10];

    int marks;

    }s[10];

    void main()

    {

    int i,n;

    clrscr();

    printf("Enter Upper limit:");

    scanf("%d",&n);

    printf("Enter student details:\n");

    printf("Enter the RollNo,Name and Mark:\n");

    for(i=1;i

  • 7/30/2019 CP RECORD

    64/71

    OUTPUT:

    Enter Upper limit:4

    Enter student details:

    Enter the RollNo,Name and Mark:

    1 Ram80

    2 Peter 90

    3 Krish 88

    4 Anwar 77

    Student details are

    Roll no Name Marks

    1 Ram 80

    2 Peter 90

    3 Krish 88

    4 Anwar 77

  • 7/30/2019 CP RECORD

    65/71

    FUNCTION WITH ARGUMENT AND NO RETURN VALUE

    AIM

    To write program to illustrate function with arguments and no return value.

    ALGORITHM:

    STEP-1 Start the program

    STEP-2 Enter the two numbers

    STEP-3 Call the function with argument passing to the calling function

    STEP-4 Add the two numbers in the calling function

    STEP-5 Print the addition of two values.

    STEP-6 End the program in the calling function.

    FLOWCHART:

    Start

    Stop

    Read a,b

    Call

    function(a,b)

    Print c

    Call

    function(a,b)

    c=a+b

    return

  • 7/30/2019 CP RECORD

    66/71

    PROGRAM:

    //FUNCTION WITH ARGUMENT BUT NO RETURN VALUES

    #include#include

    void main()

    {

    int a,b;

    void add(int, int);

    clrscr();

    printf(Enter two numbers);

    scanf(%d%d,&a,&b);

    add(a,b);

    getch();

    }

    void add(int a,int b)

    {

    int c;

    c=a+b;

    printf(The addition of two numbers %d and %d is %d,a,b,c);

    }

    OUTPUT:

    Enter two numbers10 20

    The addition of two numbers 10 and 20 is 30

  • 7/30/2019 CP RECORD

    67/71

    SEQUENTIAL SEARCH

    AIM

    To write a C program to perform sequential search using functions.

    ALGORITHM:

    STEP-1 Start the program

    STEP-2 Read the size of the array n

    STEP-3 Setup for loop i 0; until i

  • 7/30/2019 CP RECORD

    68/71

    FLOWCHART

    Read

    data

    Print

    Element

    not found

    Stop

    Start

    Read n

    Flag=search(

    a,n,data)

    Flag

    =-1

    Print

    Element

    found

    For

    i=0;i

  • 7/30/2019 CP RECORD

    69/71

    PROGRAM:

    //SQUENTIALO SEARCH

    #include

    #includevoid main()

    {

    int i, n, data, flag, a[50];

    int search(int[], int, int);

    clrscr();

    printf(\n Enter the no. elements in an array\n);

    scanf(%d,&n);

    printf(\nEnter the array elements one by one\n);

    for(i=0;i

  • 7/30/2019 CP RECORD

    70/71

    }

    return -1;

    }

    OUTPUT:

    Enter the No. element in an array

    5

    Enter the array elements one by one

    22

    75

    90

    46

    83

    Enter the element to be search

    46

    Given element 46 is found in the location 3

  • 7/30/2019 CP RECORD

    71/71