DOEACC A3-R3 July, 2007 Question paper

5.
a)    Write a ‘C’ program to compute the following series:
        1 – x + x2 /2 – x3 /6 + x4 /24 +...+ (-1)n xn /n!
Where n and x is to be accepted by the user.
b)    Develop a flowchart and then write a ‘C’ program to sort strings passed to the program through the command line arguments. Also display the sorted strings.
(6+9)
6.
a)    Define a structure to store roll_no, name and marks of a student.
b)    Using the structure of Q6. a), above write a ‘C’ program to create a file “student.dat”. There must be one record for every student in the file. Accept the data from the user.
c)    Using the “student.dat” of Q6. b), above write a ‘C’ program to search for the details of the student whose name is entered by the user.
(3+6+6)
 7.
a)    Write a ‘C’ function to reverse a singly linked list by traversing it only once.
b)    Write a ‘C’ function to remove those nodes of a singly linked list which have duplicate data. Assume that the linked list is already in ascending order.

(7+8)
8.
a)    What do you understand by loading and linking of a program?
b)    Write a ‘C’ function to generate the following figure for n = 7.
    
The value of n is passed to the function as an argument. Print the triangle only if n is odd otherwise print an error message.
c)    Write a ‘C’ function to arrange the elements of an integer array in such a way that all the negative elements are before the positive elements. The array is passed to it as an argument.


(3+6+6) 
9.
a)    Write a recursive function in ‘C’ to count the number of nodes in a singly linked list.
b)    Develop a flowchart and then write a ‘C’ program to add two very large positive integers using arrays. The maximum number of digits in a number can be 15.
(5+10)
 

No comments:

Post a Comment