Article

EDP

C & DS

Engg.Chemistry

Engg.Physics

UNIT - III

IMPORTANT QUESTIONS

  • 1. (a) What is a pointer? How is a pointer initiated? Give an example?

        (b) State whether each of the following statement is true or false. Give reasons.
            (i) An Integer can be added to a pointer.
            (ii) A pointer can never be subtracted from another pointer.
            (iii) When an array is passed as an argument to a function, a pointer is passed.
            (iv) Pointers can not be used as formal parameters in headers to function
                  definitions.
    (c) If m and n have been declared as integers and p1 and p2 as pointers to integers,
         then find out the errors, if any, in the following statements.
            (i) p1=&m;
            (ii) P2=n;
            (iii) M=p2-p1;
            (iv) *p1=&n;

    2. (a) Explain the process of accessing a variable through its pointer. Give an
             Example.

        (b) Write a C program using pointers to read in an array of integers and print its
              elements in reverse order?

    3. (a) Write a C program using pointer for string comparison.

        (b) Write a C program to arrange the given numbers in ascending order using
              pointers.

    4. (a) How to use pointer variables in expressions? Explain through examples?

        (b) Write a C program to illustrate the use of pointers in arithmetic operations.

    5. (a) Explain the process of declaring and initializing pointers. Give an example.

        (b) Write a C program that uses a pointer as a function argument.

    6. Write short notes on pointers.

    7. (a) Write a C program to illustrate the use of structure pointer.

        (b) Explain the effects of the following statements.
             (i) int a, *b=&a;
             (ii) int p, *p;
             (iii) char *s;
             (iv) A=(float*)&X;

    8. (a) Write a C program to compute the sum of all elements stored in an array using
              pointers.

        (b) Write a C program using pointers to determine the length of a character string.

    9. (a) In what way array is different from an ordinary variable?
        (b) What conditions must be satisfied by the entire elements of any given array?
        (c) What are subscripts ? How are they written? What restrictions apply to the
              values that can be assigned to subscripts?
        (d) What advantages are there in defining an array size in terms of a symbolic
              constant rather than as a fixed integer quantity?
        (e) Write a program to find the largest element in an array

     

Industry      Interaction

Higher Education

Job Skills

Soft Skills

Comm. English

Mock Test

E-learning