www.andhracolleges.

Code No: R05010106

Set No. 1

I B.Tech Supplimentary Examinations, Aug/Sep 2007 C’ PROGRAMMING AND DATA STRUCTURES ( Common to Civil Engineering, Electrical & Electronic Engineering, Electronics & Communication Engineering, Computer Science & Engineering, Electronics & Instrumentation Engineering, Bio-Medical Engineering, Information Technology, Electronics & Control Engineering, Computer Science & Systems Engineering, Electronics & Telematics, Electronics & Computer Engineering, Aeronautical Engineering and Instrumentation & Control Engineering) Time: 3 hours Max Marks: 80 Answer any FIVE Questions All Questions carry equal marks ⋆⋆⋆⋆⋆

www.andhracolleges.com
1. Write about space requirements for variables of diﬀerent data types. [16] (b) Write a C program that uses a function to sort an array of integers. 3. (a) What is a pointer? How is a pointer initiated? Give an example. i. ii. iii. iv. i. ii. iii. iv. p1 = &m; p2 = n; m=p2-p1; *p1 = &n;

2. (a) What do you mean by functions? Give the structure of the functions and explain about the arguments and their return values. [8+8]

(b) State whether each of the following statements is true or false. Give reasons. An integer can be added to a pointer. A pointer can never be subtracted from another pointer. When an array is passed as an argument to a function, a pointer is passed. Pointers can not be used as formal parameters in headers to function deﬁnitions.

www.andhracolleges.com
5. (a) Distinguish between text mode and binary mode operation of a ﬁle.
www.andhracolleges.com

(c) If m and n have been declared as integers and p1 and p2 as pointers to integers, then ﬁnd out the errors, if any, in the following statements.

[4+6+6]

4. (a) Explain with an example how a structure can be organized in the ‘C’ language? (b) Write a C program to print maximum marks in each subject along with the name of the student by using structures. Take 3 subjects and 3 students records. [8+8]

(b) Write a program to open a pre-existing ﬁle and add information at the end of ﬁle. Display the contents of the ﬁle before and after appending. [4+12] 6. Declare a circular queue of integers such that F points to the front and R points to the rear. Write functions
Seminar Topics - Scholarships - Admission/Entrance Exam Notifications 1 ofUSA-UK-Australia-Germany-France-NewZealand Universities List 2 Engineering-MBA-MCA-Medical-Pharmacy-B.Ed-Law Colleges Information

Code No: R05010106 (a) To insert an element into queue (b) To delete an element from queue.

Set No. 1
[8+8]

www.andhracolleges.com
⋆⋆⋆⋆⋆

8. (a) Write a C program to search for a given element in the integer array using binary search. (b) Write a C program to sort the elements of an array using tree sort method with suitable example. [8+8]

www.andhracolleges.com
Seminar Topics - Scholarships - Admission/Entrance Exam Notifications 2 ofUSA-UK-Australia-Germany-France-NewZealand Universities List 2 www.andhracolleges.com Engineering-MBA-MCA-Medical-Pharmacy-B.Ed-Law Colleges Information

Code No: R05010106

Set No. 2

I B.Tech Supplimentary Examinations, Aug/Sep 2007 C’ PROGRAMMING AND DATA STRUCTURES ( Common to Civil Engineering, Electrical & Electronic Engineering, Electronics & Communication Engineering, Computer Science & Engineering, Electronics & Instrumentation Engineering, Bio-Medical Engineering, Information Technology, Electronics & Control Engineering, Computer Science & Systems Engineering, Electronics & Telematics, Electronics & Computer Engineering, Aeronautical Engineering and Instrumentation & Control Engineering) Time: 3 hours Max Marks: 80 Answer any FIVE Questions All Questions carry equal marks ⋆⋆⋆⋆⋆

www.andhracolleges.com
5. Write a C program to read a text ﬁle and to count (a) number of characters, (b) number of words and (c) number of sentences and write in an output ﬁle. 6. Write a non-recursive simulation of Towers of Hanoi problem. [16]

1. (a) Write a program to determine and print the sum of the following harmonic series for a given value of n: 1+1/2+1/3+.....+1/n. (b) What are the logical operators used in C and illustrate with examples. [8+8] 2. (a) What do you mean by functions? Give the structure of the functions and explain about the arguments and their return values. (b) Write a C program that uses a function to sort an array of integers. [8+8]

www.andhracolleges.com
8. Trace through the steps by hand to sort the following list in Quick sort. 28 7 39 3 63 13 61 17 50 21 ⋆⋆⋆⋆⋆
www.andhracolleges.com

3. (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. [8+8] 4. (a) Explain the advantages of structure type over the array type variable. (b) Deﬁne a structure that represent a complex number (contains two ﬂoatingpoint members, called real and imaginary). Write a C program to add, subtract, and multiply two complex numbers. [6+10]

[16]

7. Explain non-recursive and recursive algorithm for Postorder traversal of binary tree. [16] [16]

Seminar Topics - Scholarships - Admission/Entrance Exam Notifications 1 ofUSA-UK-Australia-Germany-France-NewZealand Universities List 1 Engineering-MBA-MCA-Medical-Pharmacy-B.Ed-Law Colleges Information

Code No: R05010106

Set No. 3

I B.Tech Supplimentary Examinations, Aug/Sep 2007 C’ PROGRAMMING AND DATA STRUCTURES ( Common to Civil Engineering, Electrical & Electronic Engineering, Electronics & Communication Engineering, Computer Science & Engineering, Electronics & Instrumentation Engineering, Bio-Medical Engineering, Information Technology, Electronics & Control Engineering, Computer Science & Systems Engineering, Electronics & Telematics, Electronics & Computer Engineering, Aeronautical Engineering and Instrumentation & Control Engineering) Time: 3 hours Max Marks: 80 Answer any FIVE Questions All Questions carry equal marks ⋆⋆⋆⋆⋆

www.andhracolleges.com
(b) Write a program to print the following outputs using for loops: i) 1 ii) 1 2 2 2 2 3 3 3 3 3 3 4 4 4 4 4 4 4 4 2. (a) Distinguish between user deﬁned and built-in functions. 4. (a) How to compare structure variables? Give an example.

1. (a) What is meant by looping? Describe any two diﬀerent forms of looping with examples. [8+8]

(b) What is meant by function prototype. Give an example function prototype. [8+8]

www.andhracolleges.com
6. Write an algorithm to convert the inﬁx expression into postﬁx expression.
www.andhracolleges.com

3. (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. [8+8]

(b) Deﬁne a structure type struct ABS, that contains name, age, designation, and salary. Using this structure, write a C program to read this information for one person from the keyboard and print the same on the screen. [6+10]

5. (a) Write a C program to read last ‘n’ characters of the ﬁle using appropriate ﬁle function. (b) Write a C program to read a text ﬁle and convert the ﬁle contents in capital (upper-case) and write the contents in a output ﬁle. [16] [16]

7. Write a C program to create a linear linked list interactively and to print out the list and the total number of items in the list. [16]
Seminar Topics - Scholarships - Admission/Entrance Exam Notifications 1 ofUSA-UK-Australia-Germany-France-NewZealand Universities List 2 Engineering-MBA-MCA-Medical-Pharmacy-B.Ed-Law Colleges Information

Code No: R05010106 8. Write in detail about the following: (a) Exchange sort (b) Binary search ⋆⋆⋆⋆⋆

Set No. 3

[8+8]

www.andhracolleges.com www.andhracolleges.com
Seminar Topics - Scholarships - Admission/Entrance Exam Notifications 2 ofUSA-UK-Australia-Germany-France-NewZealand Universities List 2 www.andhracolleges.com Engineering-MBA-MCA-Medical-Pharmacy-B.Ed-Law Colleges Information

Code No: R05010106

Set No. 4

I B.Tech Supplimentary Examinations, Aug/Sep 2007 C’ PROGRAMMING AND DATA STRUCTURES ( Common to Civil Engineering, Electrical & Electronic Engineering, Electronics & Communication Engineering, Computer Science & Engineering, Electronics & Instrumentation Engineering, Bio-Medical Engineering, Information Technology, Electronics & Control Engineering, Computer Science & Systems Engineering, Electronics & Telematics, Electronics & Computer Engineering, Aeronautical Engineering and Instrumentation & Control Engineering) Time: 3 hours Max Marks: 80 Answer any FIVE Questions All Questions carry equal marks ⋆⋆⋆⋆⋆

www.andhracolleges.com
1. Write about space requirements for variables of diﬀerent data types. [16] 2. (a) Write a program to sort the set of strings in an alphabetical order? Result = “Pass” else “Fail” 6. Declare a queue of integers. Write functions (a) To insert an element in to queue (b) To delete an element from queue 7. (a) Deﬁne graph. Explain the properties of a graph.

(b) How are multidimensional arrays deﬁned? Compare with the manner in which one-dimensional arrays are deﬁned. [10+6] 3. (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. [8+8]

www.andhracolleges.com
www.andhracolleges.com

4. (a) Diﬀerentiate between a structure and union with respective allocation of memory by the compiler. Given an example of each. (b) Write a program to read n records of students and ﬁnd out how many of them have passed. The ﬁelds are student’s roll no, name, mark and result. Evaluate the result as follows if markes > 35 then

[6+10]

5. Write a C program to replace every 5th character of the data ﬁle, using fseek( ) command. [16]

[8+8]

(b) What is the diﬀerence between strongly connected graph and weakly connected graph? [8+8]
Seminar Topics - Scholarships - Admission/Entrance Exam Notifications 1 ofUSA-UK-Australia-Germany-France-NewZealand Universities List 2 Engineering-MBA-MCA-Medical-Pharmacy-B.Ed-Law Colleges Information