MCA MAGADH UNIVERSITY QUESTIONS (2009-2012) Programming and Data structure with "C"

MCA MAGADH UNIVERSITY QUESTIONS (2009-2012) Programming and Data structure with     "C" 

MCA MAGADH UNIVERSITY QUESTIONS (2009-2012) Programming and Data structure with "C"



                                                            Full Marks: 80
                                                            Time : 4 hours
                                            The questions are of equal value

                                            Answer five questions including Question 1
                                                             Which is compulsory

  1. Indicate the correct answers of the following:

   (a)  ........................   does not contain any program logic and is ignored
             by the language Processor.

    (i)  Protocol
    (ii) Virus
    (iii) Comment
    (iv) None of the above.

 (b) A character variable can at a time store
     (i) 1 character
     (ii) 8 character
     (iii) 254 character
     (iv) None of the above

 (c)  A do-while loop is useful when we want that the statements within the loop
       must be executed
  (i) only once
  (ii) at least once
  (iii) more than once
  (iv) None of the above

 (d) IF x is an integer variable, then x= 5/2;
       will return a value
  (i) 2.5
  (ii) 3
  (iii) 2
  (iv) None of the above

 (e) Which of the following is the correct way of
        declaring a float pointer?
 (i) float ptr;
 (ii) float *ptr;
 (iii) * float ptr;
 (iv) None of the above

 (f) A recursive function would result in infinte
      recursion, if the following were left out.

 (i) base case
 (ii) recursive call
 (iii) subtraction
 (iv) local variable declarations

 (g) Void main ( )
      { while (1)
         { printf("Hellow World"); }
       }
  The output
 (i) is compile time error
 (ii) goes into an infinite loop
 (iii) is Hello World
 (iv) None of these options

 (h) The program, which translates high level program into its equivalent machine
        language program, is called
  (i) transformer
  (ii) language processor
  (iii) converter
  (iv) None of these options

 2. (a) Explain the basic structure of a 'C' program.
     (b) Describe the various data types with syntax.


3. (a) What is an algorithm? What are the necessary steps for writing an algorithm?
         Differentiate  between flow chart and pseudo code.
    (b) Draw a flow chart for finding the smallest number from given three numbers.

4.(a) Describe briefly the difference among local variables, parameters and global
         variables.
   (b) Write a program in 'C' language to find out whether an input number is an odd
           number or even number.
5.(a) What is type casting? Explain it with an example. Write the syntax for
        conditional operator with an example.
   (b) Differentiate between continue statement and break statement with a suitable examples.

6. (a) Write a program to print all prime numbers from 1 to 100.
    (b) Write a program to produce the following output:
            *
            * *
            * * *
            * * * *

7. (a) What is recursion? Explain recursion technique with an example.
    (b) Explain about the storage classes in 'C' language
          with suitable examples.

8. (a) What is function and how can you declare it in 'C' language?
          Write a function power  (a,b) to calculate the value of  b is power of a.
   (b)  What is pointer ? What are call by value and call by reference ?
            Explain both with suitable examples.

 9. (a) Write a program to obtain transpose of a 4x4 matrix. The transpose of a matrix  is obtained  by exchanging the elements of each row with the elements of the corresponding column.

     (b) Define the use of the following functions with syntax and examples
         (i) strlen ( )
         (ii) strcpy ( )
         (iii) strcmp ( )
         (iv) strcat ( )

10. (a) Write a pseudo code for insertion and deletion from a stack.
      (b) Translate each infix expression into its equivalent prefix and postfix
            expression:
          (A-B) * (D/E)

11. (a) What is queue? What is a circular queue? How does it differ from linear  queue?
      (b) What is a linear linked list? How do you perform insertion and deletion
             operation in such a list?
12. What is binary tree ? What are the different tree traversal techniques?
         Describe all  techniques using a suitable example.

13. Write short notes any two from the following:
 
    (a) Structures and union
    (b) Operator
    (c) Macro
    (d) Switch case.


     

Comments

Popular posts from this blog

MCA MAGADH UNIVERSITY QUESTION (2015-2018) (Semester-iii) Database Management Systems

MCA MAGADH UNIVERSITY QUESTION (2010-2013) (Fifth Semester) Artificial Intelligence and Application

BCA MAGADH UNIVERSITY QUESTION (2011)