Jawaharlal Nehru Technological University, Hyderabad
Jawaharlal Nehru Technological University, Hyderabad
Jawaharlal Nehru Technological University, Hyderabad
COMPUTER PROGRAMMING
(Common to all Branches)
Time: 3 hours
Max. Marks: 75
(2M)
(2M)
(2M)
(2M)
(2M)
5 x 3 = 15 Marks
(3M)
(3M)
h) Write a program to show that pointer of any data type occupies same space.
(3M)
i) Explain the possible modes of opening files? In all these modes what happens
when the file doesnt exist and the file already exists?
(3M)
(3M)
(7M)
(3M)
(OR)
b) i. What is the difference between break and continue statements? Explain with
example.
(4M)
ii. Write an algorithm and program to find the average of even numbers between 1
and n.
(6M)
(2M)
(8M)
(OR)
b) i. Write a C program to find the factorial of a number using recursion.
ii. Write a C program to add two matrices.
(5M)
(5M)
(6M)
(4M)
(OR)
b) i. Explain with suitable examples the dynamic memory allocation functions
available in C.
(4M)
(6M)
5. a) Write a C program that defines a structure student to contain name, HTNO, branch
and define the nested structure marks with member subject1, subject2, subject3 and
total. Define three functions where one function sums the marks in subject1, subject2
and subject 3 and places the sum in the total. The second function is used to display
the details of the students with marks. The third function is used to display the details
according to the ascending order of marks.
(10M)
(OR)
b) i. Write a program in C that reads the name of a file and displays the contents of
the file on the user screen in reverse.
ii. Why we cannot use relation and logical operators in structure variable?
6. a) i. Write a C program for selection sort using functions.
ii. What is a doubly linked list? What is the advantage over singly linked list?
(8M)
(2M)
(7M)
(3M)
(OR)
b) i. Write a C program to implement the operations of stack using linked list.
ii. Discuss the time complexities of different search techniques.
@@@@@
[This is sample paper only]
(7M)
(3M)