qp kakinada set 1 (jan 2012)

Upload: kasaragadda-mahanthi

Post on 04-Jun-2018

214 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/13/2019 QP Kakinada Set 1 (Jan 2012)

    1/3

    Code No: R10105/R10

    IB.Tech I Semester Regular Examinations, January 2012C Programming

    (Common to All Branches)

    Time: 3 hours Max Marks: 75

    Answer any Five Questions

    All Questions Carry Equal Marks

    1. a) What is an algorithm? Write an algorithm to arrange three integer elements in ascendingorder.

    b) What are the programming development steps? Explain. 8m + 7m

    (a) Algorithm:

    Refer Section 1.8 & 1.9

    Algorithm to arrange three integer elements in ascending order:

    Step 1: Start

    Step 2 : Accept three numbers from user (a, b, c)

    Step 3 : If a < b then goto step 4 else goto step 8

    Step 4 : if a < c then goto step 5 else goto step 7

    Step 5 : If b < c then goto step 9 else goto step 6

    Step 6 : Interchange b and c and goto step 9

    Step 7 : Interchange a and c and goto step 3

    Step 8 : Interchange a and b and goto step 3

    Step 9 : Display Ascending order

    Step 10 : Display a, b, c

    Step 11 : Stop

    (b) Refer Section 1.22

    Solved Question Paper(JANUARY 2012) SET-1

  • 8/13/2019 QP Kakinada Set 1 (Jan 2012)

    2/3

    SQP-1.2 C Programming

    2. a) Write briefly about the C Tokens with suitable examples

    b) Write a program to find the largest of three numbers using conditional operator 7m + 8m

    a) Refer section 1.27, 1.28 and 1.29 b)

    # include

    # include

    void main()

    {

    int a, b, c, big ;

    clrscr() ;

    printf("Enter three numbers : ") ;

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

    big = (a > b) ? (a > c ? a : c) : (b > c ? b : c) ; printf("\nThe biggest number is : %d", big) ;

    getch() ;

    }

    3 a) Write briefly about bit-wise operators with suitable examples.

    b) Write a program to award the grade to the students, based on average marks ( Use switch

    statement) 8m + 7m

    a) Refer Section 1.51

    b) Refer Page SQP 2.9, question 6(b)

    4. What are different types of iterative statements? Explain each with suitable examples.

    15m

    Refer Section 3.12, 3.13 and 3.14

    5. a) What is an array? Describe array declaration, initialization, and accessing array elements.

    b) Write a program to implement matrix multiplication using two dimensional arrays

    7m + 8m

    a) Refer Section 4.1, 4.2, 4.3 and 4.4

    b) Refer Appendix A , Example A.41

    6. a) What are the different types of storage classes? Explain each with suitable examples.

    b) Write a program to generate Fibonacci series using recursive function 7m + 8m

    a) Refer Section 5.19

    b) Refer Appendix B, Example B.6

  • 8/13/2019 QP Kakinada Set 1 (Jan 2012)

    3/3

    Solved Question Paper Set-1 SQP-1.3

    7. a) What is a pointer? Describe call by value and call by address with suitable examples.

    b) Write a program to arrange a set of strings in ascending order using pointers. 7m + 8m

    a) Refer Section 6.1, 5.7 and 6.13 b)

    #include

    #include

    void main()

    {

    char s[5][20],t[20];

    int i,j;

    clrscr();

    printf("Enter any five strings : \n");

    for(i=0;i