1. Question:What are merits and demerits of array in c? 

    Answer
    Merits:
    (a) We can easily access each element of array.
    (b) Not necessity to declare too many variables.
    (c) Array elements are stored in continuous memory location.
    
    Demerits:
    (a) Wastage of memory space. We cannot change size of array at the run time.
    (b) It can store only similar type of data

    1. Report
  2. Question:Why Pre-increment operator is faster than Post-increment? 

    Answer
    Evaluation of any expression is from left to right. Preincrement is faster because it doesn't need to save the current value for next instruction whereas Postincrement needs to saves current value to be incremented after execution of current instruction.

    1. Report
  3. Question:Difference between arrays and linked list? 

    Answer
    Major differences between arrays and linked lists are: (i)  In array consecutive elements are stored in consecutive memory locations whereas in linked list it not so. (ii)  In array address of next element is consecutive and whereas in linked list it is specified in the address part of each node.(iii) Linked List makes better use of memory than arrays.(iv) Insertion or deletion of an element in array is difficult than insertion or deletion in linked list

    1. Report
  4. Question:What is the use of typedef? 

    Answer
    (i) It increases the portability.
    (ii) It simplify the complex declaration and improve readability of the program.

    1. Report
  5. Question:What are library Functions? 

    Answer
    Library Functions are predefined functions and stored in .lib files.

    1. Report
  6. Question:What is a structure? 

    Answer
    Structure is a collection of heterogeneous (i.e. related data items which can be of different types) held together to a single unit. The data items enclosed within a structure are called its members which may be of data type int, float, char, array etc.

    1. Report
  7. Question:What is a pointer? 

    Answer
    Pointer is a variable that contains address of another variable in the memory. Pointers are quite useful in creation of linked data structures (such as linked lst, trees graphs), managing object allocated memory dynamically, optimize the program to execute faster and use less memory.

    1. Report
  8. Question:What are macros? What are its advantages and disadvantages? 

    Answer
    Macro is a Pre-processor.Major advantage of using the macro is to increase the speed of the execution of the program.
    Major disadvantage of the macros are:
    (i) No type checking is performed in macro. This may cause error.
    (ii)  A macro call may cause unexpected results.

    1. Report
  9. Question:What is difference between Structure and Unions? 

    Answer
    i)    In structure every member has its own memory whereas in union its members share the same member space.
    (ii)  In structure, it is possible to initialize all the members at the same time which is not possible in case of union.
    (iii) A structure requires more space than union(for the same type of members).
    (iv) In union different interpretations of the same memory space are possible which is not so in case of structures.

    1. Report
  10. Question:What are the advantages of using Unions? 

    Answer
    (i) Efficient use of memory as it it does not demand memory space for its all members rather it require memory space for its largest member only.
    (ii) Same memory space can be interpreted differently for different members of the union.

    1. Report
Copyright © 2024. Powered by Intellect Software Ltd