DOEACC A3-R3 July, 2008 Question paper

5.
a)    What is structured programming? Explain and give examples of relevant constructs using pseudo-code. Highlight the advantages and disadvantages of structured programming.
b)    What is an execution error? Differentiate it from syntactic error. Give examples.
c)    It is said that ‘C’ is a middle level assembly language. Mention those features of ‘C’ which enable this description.

(8+3+4)
6.
a)    Write and explain the action of WHILE statement. Develop a program in ‘C’ language to compute the average of every third integer number lying between 1 and 100. Include appropriate documentation.
b)    Develop a function to calculate sum of n even integers starting from a given even integer.
c)    Identify all the compound statements which appear in the following program segment:

{
    sum=0;
    do
    {
        scanf(“%d”, &i);
        if (i < 0)
        {
            i=-i;
            ++flag;
        }
        sum += i;
    } while (i != 0);
}

(7+5+3)
7.
a)    Define an array. How are arrays processed in ‘C’? Illustrate by taking two-dimensional arrays as examples.
b)    What are subscripts? How are they specified? What restrictions apply to the values that can be assigned to subscripts in ‘C’ language?
c)    Write a ‘C’ program that will enter a line of text, store in an array and then display backwards. The length of the line should be undefined, (being terminated by ENTER key), but less than 80 characters.

(4+4+7)
8.
a)    What is a pointer in ‘C’? How is a pointer variable declared? Give examples and explain. Enumerate the utility of pointer variables.
b)    A program in ‘C’ language contains the following declaration:
    static int x[8] = {1,2,3,4,5,6,7,8};
    i)    What is the meaning of x?
    ii)    What is the meaning of (x + 2)?
    iii)    What is the meaning of *x?
    iv)    What is the meaning of (*x + 2)?
    v)    What is the meaning of *(x + 2)?
c)    What is a structure? How does a structure differ from a union? Give examples. For what kind of applications, union data structure is useful? How are arrays different from structure?
(4+5+6)
9.
a)    How can a procedure be defined in ‘C’? Give an example. Bring out the differences between function and procedure.
b)    Draw a flowchart and then develop an interactive ‘C’ program which finds whether a given integer number is prime or not. Make use of a function subprogram.
(6+9)

No comments:

Post a Comment