You are on page 1of 9

www.jntuworld.

com

www.jwjobs.net

UNIT 1

1. (a) Define Psuedocode.


(b) Define flowchart.
(c) What are the different stages in the program development? [3+3+10 marks]
(May/june 2008 Set 1)
2. (a) Explain the working of Unary Operator with example.
(b) Explain the working of Binary Operator with example.
(c) Explain the working of assignment Operator with example.
(d) Explain the working of ternary Operator with example. [4+4+4+4
marks](May/june 2008 Set 2)
3. What are the different types of control statements available 'C'. Explain them withan
example? [16](May/june 2008 Set 3)
4. (a) Define Algorithm.
(b) What is the use of flowchart ?
(c) What are the different steps followed in the program development? [3+3+10
marks](May/june 2008 Set 4)
5. (a) Write a 'C' program to find the squares of N numbers using do - while.
(b) Write a 'C' program to convert Decimal Number to Octal Number. [8+8
marks](May/june 2009 Set 1)
6. What are the different format specifiers available for Input and Output
statements.Explain with an example? [16 marks](May/june 2009 Set 2)
7. (a) Mention the use of sizeof and pointer operator in 'C'. Explain them with a
program.
(b) How comma and member selection operators used in 'C'. Explain with program.
[8+8 marks](May/june 2009 Set 3)
8. How algorithm is different from flowchart? Write an algorithm and draw flowchart
for finding greatest among three given numbers. [8+8](May/june 2009 Set 4)
9. Write about space requirements for variables of different data types. [16 marks](june
Supplementary 2009 Set 1)
10. (a) What is meant by operator precedence? What are the relative precedence of the
arithmetic operators?
(b) What is the associativity of the arithmetic operators?
(c) How can the value of an expression be converted to a different data types? What is
this called?
(d) What are unary operators? Explain example for each. [4+4+4+4 marks]
11. Write a program to find the sum of all digits in a given number. Repeat this operation
successively until the result is a single digit. [16]
12. Write a C program to print the lower triangular of a given square matrix. [16 marks]
13. (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 marks]
14. (a) What is a string constant? How do string constants di er from character constants?
Do string constants represent numerical Values?
(b) Summarize the standard escape sequences in C. Describe them.
(c) What is a variable? How can variables be characterized? Give the rules for
variable declaration.

m
o
.c

d
l
r
o

w
tu

n
j
.
w

w
w

www.jntuworld.com

www.jntuworld.com

www.jwjobs.net

(d) What is the purpose of type declarations? What are the components of
typedeclaration? [4+4+4+4 marks]
15. (a) Explain the following & illustrate it with an example each.
i. Increment & Decrement operator.
ii. Conditional operator.
iii. Bitwise operator.
iv. Assignment operator.
(b) State the rules that applied while evaluating expression in automatic type
conversion. [12+4 marks]
16. (a) In what way array is di erent from an ordinary variable?
(b) What conditions must be satisfied by the entire elements of any given array?
(c) What are subscripts? How are they written? What restrictions apply to the values
that can be assigned to subscripts?
(d) What advantage is there in defining an array size in terms of a symbolic constant
rather than a fixed integer quantity?
(e) Write a program to find the largest element in an array. [3+2+3+3+5 marks]
17. (a) What is a preprocessor directive.
(b) Distinguish between function and preprocessor directive.
(c) What is the significance of conditional compilation.
(d) How does the undefining of a pre-defined macro done. [4+4+4+4 marks]
18. (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 marks]
19. (a) What is a string constant? How do string constants di er from character constants?
Do string constants represent numerical Values?
(b) Summarize the standard escape sequences in C. Describe them.
(c) What is a variable? How can variables be characterized? Give the rules for
variable declaration.
(d) What is the purpose of type declarations? What are the components of
typedeclaration? [4+4+4+4 marks]
20. (a) Explain the following & illustrate it with an example each.
i. Increment & Decrement operator.
ii. Conditional operator.
iii. Bitwise operator.
iv. Assignment operator.
(b) State the rules that applied while evaluating expression in automatic type
conversion. [12+4 marks]
21. (a) Describe the two different forms of the if-else statement. How do they differ?
(b) Compare the use of the if-else statement with use of the ?: operator. In particular,
in what way can the ?: operator be used in place of an if-else statement?
(c) Admission to a professional course is subject to the following conditions:
i. marks in maths >= 60.
ii. marks in physics >= 50.
iii. marks in chemistry >= 40.
iv. total in all three subjects >= 200.
Given the marks in three subjects, write a C program to process the application to find
whether eligible or not. [5+6+5]
22. (a) What are the general characteristics of C?
(b) Give and Explain the structure of a C program?
(c) Write a C program to print the Pascal's triangle. [4+4+8 marks]

m
o
.c

d
l
r
o

w
tu

n
j
.
w

w
w

www.jntuworld.com

www.jntuworld.com

www.jwjobs.net

UNIT 2

1. (a) Give some important points while using return statement.


(b) Write short notes on scope of a variable. [8+8 marks]
2. What is the advantage of using functions. Write a 'C' program to explain about built in
functions with an example. [16]
3. (a) Write short notes on auto and static storage classes.
(b) Write short notes on call by reference . [8+8 marks]
4. Write a program to find sum of given series by using function with argument and
return value e = 2 + 3/1! - 6/2! + 9/3! - 12/4! .....! [16]
5. Write a program to evaluate the equation s = sqr(m() + n() ) using function. [16
marks]
6. How automatic and static variables are used in different blocks. Explain with a
program. [16]
7. Write a program to find sum of given series by using function with argument and
return value e = 2 + 3/1! - 6/2! + 9/3! - 12/4! .....! [16]
8. What is a function ? What are the di erent types of functions? Explain function with
no argument and no return type with an example. [16]
9. (a) Write a program to demonstrate passing an array argument to a function. Consider
the problem of finding largest of N numbers defined in an array.
(b) Write a recursive function power (base, exponent) that when invoked returns base
exponent. [8+8 marks]
10.
11. (a) Distinguish between user defined and built-in functions.
(b) What is meant by function prototype. Give an example function prototype.[8+8
marks]
12. (a) Distinguish between getchar and scanf functions for reading strings.
(b) Write a program to count the number of words, lines and characters in a text.[8+8
marks]
13. (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 marks]

m
o
.c

d
l
r
o

w
tu

n
j
.
w

w
w

UNIT 3

1. Explain an array , array declaration and features of array. [16 marks] (May/June 2008SET 1 & 2)
2. Explain call by value and call by reference and nesting of function. [16 marks]
(May/June 2008-SET 2)
OR
Explain in detail about pass by values and pass by reference. Explain with a sample
program. [8 marks] (April/May 2003-SET 1)

www.jntuworld.com

www.jntuworld.com

www.jwjobs.net

3. Write a program to swap the contents of given variable. [16 marks] (May/June 2008SET 3)
4. (a) Write short notes on pointer to void.
(b) Write short notes on Address Arithmetic. [8+8 marks] (May/June 2008-SET 3)
5. Define Multi dimensional array with an example. [16 marks] (May/June 2008-SET 4)
6. Write short notes on pointers. [16 marks] (May/June 2008-SET 1) (June 2009-SET 1)
7. What is the advantage of using arrays ? Give syntax for declaration, accessing and
printing one-dimensional array? [16 marks] (May/June 2008-SET 2)
8. Define an array. What are the different types of arrays. Explain. [16 marks]
(May/June 2008-SET 3)
9. Write short notes on call by reference. [8 marks] (May/June 2008-SET 3)
10. How can a list of strings be stored in an two - dimensional array? What library
functions are available to simplify string processing? [16 marks] (June 2009-SET 2)
11. Write a program to reverse the strings stored in array of pointers. [16 marks] (June
2009-SET 3)
12. Write a C program to explain call by value and call by reference concept. [10 marks]
(June 2009-SET 4)
13. (a) Write a program to accept N numbers and print whether the number is even or odd
using array.
(b) Write short notes on one dimensional array. [10+6 marks] (June 2009-SET 4)
14. (a) Explain how strings can be stored using a multidimensional arrays?
(b) What are the string in-built functions available? Write in detail about each one of
them with an example.
(c) The names of employees of an organization are stored in three arrays, namely, first
name, second name, and last name. Write a program to concatenate the three parts
into one string to be called name. [16 marks] (June 2005)
15. (a) Explain the process of declaring and initializing pointers. Give an example.
(b) Write a C program that uses a pointer as a function argument. [16 marks] (June
2005)
16. Write a C program that uses a function to sort an array of integers. [8 marks]
(April/May 2003-SET 2)
17. a) Distinguish between getchar and scanf functions for reading strings.
b) Write a program to count the number of words, lines and characters in a text. [16
marks] (April/May 2003-SET 3)
18. a) Write a C program to find factorial of a given number using pointers.
b) Write a C program to arrange the given names in alphabetical order using pointers.
[16 marks] (April/May 2003-SET 3)
19. a) In what way array is different from an ordinary variable?
b) What conditions must be satisfied by the entire elements of any given array?
c) What are subscripts? How are they written? What restrictions apply to the values
that can be assigned to subscripts?
d) What advantage is there in defining an array size in terms of a symbolic constant
rather than a fixed integer quantity?
e) Write a program to find the largest element in an array. [16 marks] (April/May
2003-SET 4)
20. a) Write a C program using pointer for string comparison.
b) Write a C program to arrange the given numbers in ascending order using pointers.
[16 marks] (April/May 2003-SET 4)

m
o
.c

d
l
r
o

w
tu

n
j
.
w

w
w

www.jntuworld.com

www.jntuworld.com

www.jwjobs.net

UNIT 4

1. Write a program using structures to display the following information for each
customer name, account number, street, city, old balance, current payment, new
balance, account status. [16 marks]
2. Define Structure and write the general format for declaring and accessing
members.[16 marks]
3. (a) Write a program to store and print name, address ,rollno using structures.
(b) What are the differences between structure and unions. Explain [8+8 marks]
4. Evaluate complex number using structure and pointer. [16 marks]
5. (a) How structure is implemented using arrays? Give an example.
(b) Compare structure and union. [10+6]
6. (a) Differentiate 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 find out how many of them have
passed. The fields are student's roll no, name, mark and result. Evaluate the result as
follows [6+10 marks]
if markes > 35 then Result = 'Pass' else 'Fail'
7. (a) What are the di erences between Union and Structure.
(b) Write a program to declare pointer to structure and display the contents of the
structure. Define a structure object of book with three fields: title, authorand pages.
[6+10 marks]
8. (a) What is 'union' in C? How is data stored using union.
(b) Write a program to pass address of a structure variable to user defined function
and display the contents. Use a structure ob ject boy with three fields: name, age and
height. [6+10 marks]
9. (a) What are Bit fields. What are its advantages. What is its syntax.
(b) Write a C program to store the information of vehicles. Use bit fields to store the
status information. Assume the vehicle object consists of type, fuel and model
member fields. Assume appropriate number of bits for each field.[8+8]
10. Write a C program to compute the monthly pay of 100 employees using each
employee's name, basic-pay. The DA is computed as 52% of the basic pay. Grosssalary (Basic pay+DA). Print the employees name and gross salary. [16 marks]
11. (a) Write a C program to illustrate the comparison of structure variables.
(b) What is the use of a structure? Given an example for a structure with initialized
values.[8+8 marks]
12. (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]
13. (a) Distinguish between an array of structures and an array within a structure. Give an
example each.
(b) Write a C program using structure to create a library catalogue with the following
fields; Access number, author's name. Title of the book, year of publication,
publisher's name, price. [6+10 marks]

m
o
.c

d
l
r
o

w
tu

n
j
.
w

w
w

UNIT 5

www.jntuworld.com

www.jntuworld.com

www.jwjobs.net

1. Write a program for indexed sequential file for the employee database for the
following operation.
(a) Add Record
(b) Delete Record
(c) Search Record based on the department [16 marks]
2. Write a program to read the following data , to find the value of each item and display
the contents of the file.[16 marks]
Item Code Price Quantity
Pen 101 Rs. 20 5
Pencil 103 Rs. 3 100
3. . What is the purpose of library function feof() ? How feof() be utilized within a
program that updates an unformatted data file. Explain [16 marks]
4. Describe types of files with an example . [16 marks]
5. Write a program to read series of digits and store them into a file, then read the
numbers from the file and write all odd & even numbers into di erent files. [16]
6. (a) Write the syntax for opening a file with various modes and closing a file.
(b) Explain about file handling functions . [8+8]
7. What do you mean by binary files explain with an example. [16 marks]
8. (a) Write the syntax for opening a file with various modes and closing a file.
(b) Explain about file handling functions . [8+8 marks]
9. Write a C program to read a text file and to count
(a) number of characters,
(b) number of words and
(c) number of sentences and write in an output file. [16 marks]
10. Write a C program to replace every 5th character of the data file, using fseek( )
command. [16]
11. Write a program to read a C program file and count the following in the complete C
program
(a) Total number of statements
(b) Total number of opening brackets. [8+8 marks]
12. Write a C program to read information about the student record containing student's
name, student's age and student's total marks. Write the marks of each student in an
output file. [16 marks]
13. (a) How does an append mode differs from a write mode.
(b) Compare between printf and fprint f functions.
(c) Write a program to copy upto 100 characters from a file to an output array.
14. (a) Write a C program to read last 'n' characters of the file using appropriate file
function.
(b) Write a C program to read a text file and convert the file contents in capital
(upper-case) and write the contents in a output file. [16 marks]

m
o
.c

d
l
r
o

w
tu

n
j
.
w

w
w

(a) Distinguish between text mode and binary mode operation of a file.
(b) Write a program to open a pre-existing file and add information at the end of file.
Display the contents of the file before and after appending. [4+12 marks]

UNIT 6

www.jntuworld.com

www.jntuworld.com

www.jwjobs.net

1. What do you mean by sorting? Mention the di erent types of sorting, give some
examples and explain any one indetail. [16 marks]
2. Compare the advantage and disadvantage of bubble, insertion and selection sort.
3. Write a program to sort the elements whose worst and average case are O(n log n).[16
marks]
4. Write a program to explain selection sort . Which type of technique does it belong.[16
marks]
5. Write a program to explain selection sort . Which type of technique does it belong.[16
marks]
6. Write a program to sort the elements whose worst case is O(n2) and average case is
O(n log n). [16 marks]
7. (a) Explain selection sort indetail.
(b) Explain bubble sort indetail. [8+8]
8. Write an algorithm for routine merge(x,lb1,ub1,ub2) that assumes that x[lb1] through
x[ub1] and x[ub1 + 1] through x[ub2] are sorted and merges the two into x[lb1]
through x[ub2]. [16 marks]
9. (a) Explain Quick sort with algorithm.
(b) Analyse the worst case performance of Quick sort and compare with Selection
sort.[8+8 marks]
10. (a) Write a C program to sort the elements of an array using Quick sort with suitable
example.
(b) What is the worst case and best case time complexity of the above program?
11. Write an algorithm for quick sort. What is its time complexity. [16 marks]
12. (a) Write an algorithm for selection sort
(b) Sort the following numbers using selection sort and give the required steps.
96,31,27,42,34,76,61,10,4 [8+8]
13. (a) Using linear search delete the number 26 from the list of numbers and give the
steps.
10,7,17,26,32,92
(b) Write a C program to implement the same. [8+8 marks]
14. (a) Distinguish between linear and binary search methods.
(b) Write an algorithm for non-recursive binary search method. [8+8 marks]
15. (a) Write a C program to sort the elements of an array using bubble sort technique
with a suitable example.
(b) What is the worst case and best case time complexity of bubble sort? [10+6
marks]
16. (a) Write a C program to sort given integers using partition exchange sort.
(b) Derive the time complexity of partition exchange sort. [8+8]
17. Write a C program that searches a value in a stored array using binary search. What is
the time complexity of binary search? [16 marks]
18. (a) Write a C program to merge two sorted arrays of integers.
(b) Derive the time complexity of merge sort. [8+8 marks]
19. (a) Write and explain non-recursive algorithm for binary search with suitable example
and discuss the various time complexities of binary search.
(b) Suppose that the list contains the integers 1,2,8 in this order. Trace through the
steps of binary search to determine what comparisons of keys are done in searching.
i. To lo cate 3
ii. To lo cate 4.5 [8+8 marks]

m
o
.c

d
l
r
o

w
tu

n
j
.
w

w
w

www.jntuworld.com

www.jntuworld.com

www.jwjobs.net

20. Trace through the steps by hand to sort the following list in Quick sort.
28 7 39 3 63 13 61 17 50 21 [16 marks]

UNIT 7

1. What are the advantages and disadvantages of stack ? Write a program to illustrate
stack operation ? [16 marks]
2. Give an algorithm / C program to reverse a singly linked circular list inplace. [16
marks]
3. What are the advantages and disadvantages of stack ? Write a program to illustrate
queue operation ? [16 marks]
4. Compare singly and doubly linked list to perform insertion operation . [16 marks]
5. Write a program to illustrate the various operations of singly linked list . [16 marks]
6. Write a program to delete a node in singly and doubly linked list . [16 marks]
7. Write a C program using pointers to implement Queue with all operation. [16 marks]
8. Write a routine to concatenate two singly linked lists. [16 marks]
9. What is a stack? Explain two di erent representations of a stack. List the operations
performed on a stack and write functions for implementing these operations.[16
marks]
10. (a) Write a 'C' Program to convert an infix expression into prefix expression (b)
Transform the following expression to prefix, using the approach (A + B) * (C$(D E) + F) - G [8+8 marks]
11. (a) Mention and explain various types of queues and give an example for each (b)
Compare various types of queues. [8+8 marks]
12. Write an algorithm to perform each of the following operations to a linked list. (a)
Return the sum of the integers in a list. (b) Return the number of elements in a list.
[8+8 marks]
13. Design insertion and deletion algorithms for a doubly linked circular lists. [16 marks]
14. (a) Derive a method to convert a postfix expression into its prefix form (b) Consider
the following arithmetic expression in postfix notation: 7 5 2 + * 4 1 5 - / - i. Find the
equivalent prefix form of the above . ii. Obtain the computed value of the expression
from its postfix notation.[8+4+4 marks]

m
o
.c

d
l
r
o

w
tu

n
j
.
w

w
w

UNIT 8

1. (a) What is a network? (b) What is a spanning tree? (c) Define minimal spanning tree
. (d) What are the various traversals in a tree? [16 marks]
2. Write an algorithm to perform deletion operation in a Binary Search Tree. [16 marks]
3. (a) Define multi graph and graph with self- loop . (b) Explain connected graph with
example. [8+8 marks]
4. Explain Kruskal's method of determining the minimal spanning tree. [16 marks]

www.jntuworld.com

www.jntuworld.com

www.jwjobs.net

5. (a) Write a program to swap nodes in a binary tree. (b) Write a program to find min
and max nodes in a binary tree. [8+8 marks]
6. Explain binary search tree operations indetail. [16 marks]
7. Explain non-recursive and recursive algorithm for converse in order traversal of
binary tree. [16 marks]
8. Write a C program for creating, inserting and deletion in a Binary tree. [16 marks]
9. (a) Describe di erent types of trees. (b) Write a C program to implement Binary tree.
[6+10 marks]
10. (a) List and explain about the basic operations on a graph. (b) Write a C program for
depth first search of a graph. [7+9 marks]
11. Write a C program for creating, inserting and deletion in a Binary tree. [16 marks]
12. (a) Write C function for minimum spanning tree of a weighted undirected graph (b)
Write a C program to implement depth first traversal of graph. [10+6 marks]
13. (a) List and explain about the basic operations on a graph. (b) Write a C program for
depth first search of a graph. [7+9 marks]
14. Write and explain the breath first traversal and depth first traversal in a graph with
algorithm. [8+8 marks]
15. Write in detail about the following: (a) Depth first search of a graph (b) Minimum
spanning trees [8+8 marks]
16. (a) Define graph. Explain the properties of a graph. (b) What is the di erence between
strongly connected graph and weakly connected graph? [8+8 marks]

m
o
.c

d
l
r
o

w
tu

n
j
.
w

w
w

www.jntuworld.com

You might also like