www.jntuworld.com
www.jwjobs.net
UNIT 1
1. (a) (a) Defi Define ne Psu Psued edoc ocod ode. e. (b) Define flowchart. (c) What are the different stages in the program development? [3+3+10 marks] (May/june 2008 Set 1) 2. (a) Explai Explain n the working working of Unary Unary Opera Operator tor with with example 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 are the different different types of control statements statements available available 'C'. 'C'. Explain Explain them withan example? [16](May/june 2008 Set 3) 4. (a) (a) Defi Define ne Alg Algor orit ithm hm.. (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 Write a 'C' 'C' progra program m to find find the squar squares es of N numbe numbers rs using using do - while. 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 specifiers available available for for Input Input and Output statements.Explain with an example? [16 marks](May/june 2009 Set 2) 7. (a) Mention Mention the use of sizeof and and pointer operator in 'C'. Explain them with 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 algorithm is different different from from flowchart? flowchart? Write Write an algorithm and draw flowchart flowchart for finding greatest among three given numbers. [8+8](May/june 2009 Set 4) 9. Write about space space requirements requirements for variables variables of different data types. types. [16 marks](june marks](june Supplementary 2009 Set 1) 10. (a) What is meant by operator precedence? 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 find the sum of all digits in a given number. number. Repeat this operation operation successively until the result is a single digit. [16] 12. Write a C program to print the lower triangular triangular of a given square matrix. matrix. [16 marks] 13. (a) Write a program to determine and print the sum of the following harmonic 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 string constant? constant? How do string constants constants di er from character character constants? 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.
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 following & illustrate illustrate it with an example 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 erent from an ordinary variable? 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 preprocessor directive. 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? functions? Give the structure structure of the functions and explain 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 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 following & illustrate illustrate it with an example 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 Describe the two different different forms forms of the if-else if-else statement. statement. How do they differ? 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 the general characterist characteristics ics 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]
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
UNIT 2
1. (a) Give Give some some importan importantt points points while while using using return return statemen statement. t. (b) Write short notes on scope of a variable. [8+8 marks] 2. What is the the advantage advantage of using functions. functions. Write a 'C' program program to explain explain about built in functions with an example. [16] 3. (a) Write Write short short notes notes on on auto and and static static storag storagee classes. classes. (b) Write short notes notes on call by reference . [8+8 marks] 4. Write a program to find sum of given series series by using function function with with argument argument and return value value e = 2 + 3/1! 3/1! - 6/2! + 9/3! 9/3! - 12/4! .....! .....! [16] [16] 5. Write a program to evaluate evaluate the equation s = sqr(m() sqr(m() + n() ) using function. function. [16 [16 marks] 6. How automa automatic tic and static static variab variables les are are used in differ different ent blocks blocks.. Explain Explain with with a program. [16] 7. Write a program to find sum of given series series by using function function with with argument argument and return value value e = 2 + 3/1! 3/1! - 6/2! + 9/3! 9/3! - 12/4! .....! .....! [16] [16] 8. What is a function function ? What What are the di erent types types of functions? functions? Explain function with no argument and no return type with an example. [16] 9. (a) Write Write a program program to to demonstrate demonstrate passing passing an array argument to a function. function. Consider Consider the problem of finding largest of N numbers defined in an array. (b) Write a recursive function function power (base, exponent) exponent) that when invoked returns base exponent. [8+8 marks] 10. 11. (a) Distinguish Distinguish between user defined and built-in built-in functions. (b) What is meant by function prototype. Give an example function prototype.[8+8 marks] 12. (a) Distinguish Distinguish between getchar and scanf functions 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? functions? Give the structure structure of the functions and explain explain about the arguments arguments and their return return values. (b) Write a C program that uses a function to sort an array of integers. [8+8 marks]
UNIT 3
1. Explain an array , array declaration declaration and features features of array. array. [16 marks] (May/June 20082008SET 1 & 2) 2. Explain call by value and and call by by reference reference and nesting of of function. 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 20 03-SET 1)
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
3. Write a program to swap the contents contents of given variable. variable. [16 marks] marks] (May/June (May/June 20082008SET 3) 4. (a) Write Write short short notes notes on pointer pointer to void. void. (b) Write short notes on Address Arithmetic. [8+8 marks] (May/June 2008-SET 3) 5. Define Multi dimensiona dimensionall array with an example. [16 marks] marks] (May/June (May/June 2008-SET 4) 6. Write Write short short notes on pointers pointers.. [16 marks] marks] (May/J (May/June une 2008-S 2008-SET ET 1) (June (June 2009-SE 2009-SET T 1) 7. What is the advantage advantage of using arrays arrays ? Give Give syntax syntax for declaration, declaration, accessing accessing and printing one-dimensional one-dimens ional array? [16 marks] (May/June (May /June 2008-SET 2) 8. Define an array. array. What are the different types of arrays. Explain. [16 marks] marks] (May/June 2008-SET 3) 9. Write short notes notes on call by reference. reference. [8 marks] (May/June 2008-SET 2008-SET 3) 10. How can a list list of strings be stored stored in an two - dimensional dimensional array? What library library functions are available to simplify string processing? [16 marks] (June 2009-SET 2) 11. Write a program to reverse the strings stored stored in array of pointers. [16 marks] (June 2009-SET 3) 12. Write a C program to explain explain call by value and call by reference reference concept. [10 [10 marks] (June 2009-SET 4) 13. (a) Write a program to to accept N numbers and print print whether the 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 strings can be stored using a multidimensional multidimensional arrays? 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 declaring and initializing pointers. 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 that uses a function to sort an array of integers. integers. [8 marks] (April/May 2003-SET 2) 17. a) Distinguish Distinguish between getchar and scanf functions functions for reading strings. b) Write a program to count the th e number of words, lines and characters ch aracters in a text. [16 marks] (April/May 2003-SET 3) 18. a) Write a C program to find factorial factorial of a given number number using pointers. b) Write a C program to arrange the th e given names in alphabetical alphabe tical order using pointers. poi nters. [16 marks] (April/May 2003-SET 3) 19. a) In what way array is different different from an ordinary ordinary variable? b) What conditions must be satisfied by the entire elements of any given array? arr ay? 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 using pointer for string string comparison. b) Write a C program to arrange the th e given numbers in ascending ascen ding order using pointers. poi nters. [16 marks] (April/May 2003-SET 4)
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
UNIT 4
1. Write a program using structures structures to display display the following following information information for each customer name, account number, street, city, old balance, current payment, new balance, account status. stat us. [16 marks] 2. Define Structure Structure and write the general general format format for for declaring declaring and accessing accessing members.[16 marks] 3. (a) Write Write a program program to to store and print print name, address ,rollno using structures. structures. (b) What are the differences between structure and unions. Explain [8+8 marks] 4. Evaluat Evaluatee complex complex number number using using structure structure and and pointer. pointer. [16 marks] marks] 5. (a) How How structure structure is implem implemente ented d using arrays? arrays? Give Give an example. example. (b) Compare structure and union. [10+6] 6. (a) Differentia Differentiate te between between a structure structure and union with respective respective allocation allocation of memory memory by the compiler. Given an example exa mple 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 stud ent's roll no, name, mark and result. res ult. Evaluate the result as follows [6+10 marks] if markes > 35 then Result = 'Pass' else 'Fail' 7. (a) What What are are the di erenc erences es between between Union Union and and Structu Structure. re. (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 What is 'unio 'union' n' in C? How How is data data stored stored using using union union.. (b) Write a program to pass address of a structure variable to user defined function and display the contents. Use Use a structure ob ject boy with three fields: name, age and height. [6+10 marks] 9. (a) What What are Bit fields. fields. What are are its advantages. advantages. What What is its syntax. 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 compute the monthly 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 comparison of structure variables. 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 with an example how a structure structure can be organized in the 'C' language? 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 Distinguish between an array of structures and an array within a structure. 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]
UNIT 5
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
1. Write a program for indexed indexed sequential sequential file file for the the employee employee database database for the following operation. (a) Add Record (b) Delete Record (c) Search Record based on the department [16 marks] 2. Write a program program to read the following following data , to find the value value of each 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 of library library function function feof() ? How feof() be be utilized utilized within within a program that updates an unformatted data file. Explain Expla in [16 marks] 4. Describ Describee types types of files files with with an examp example le . [16 marks marks]] 5. Write a program to read series of of digits and store store them into a file, then then read the numbers from the file and write all odd & even numbers into di erent files. [16] 6. (a) Write Write the syntax for for opening opening a file file with various modes and and closing a file. (b) Explain about file handling functions . [8+8] 7. What What do you mean mean by binary binary files files explain explain with with an example example.. [16 marks] marks] 8. (a) Write Write the syntax for for opening opening a file file with various modes and and closing a file. (b) Explain about file handling functions . [8+8 marks] 9. Write Write a C progr program am to read a text file file and to to count 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 replace every 5th character character of the data file, using using fseek( ) command. [16] 11. Write a program to read read a C program file and count the following following in the complete 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 information about the student record containing 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 mode differs from a write 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 read last 'n' characters characters of the file using appropriate 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] (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? sorting? Mention Mention the di erent types of sorting, give some some examples and explain any one indetail. [16 marks] 2. Compare the advantage advantage and disadvantage disadvantage of bubble, bubble, insertion insertion and selection selection sort. 3. Write a program program to sort the elements elements whose whose worst worst and average average case are O(n log n).[16 n).[16 marks] 4. Write a program to explain explain selection selection sort . Which type of technique does it belong.[16 belong.[16 marks] 5. Write a program to explain explain selection selection sort . Which type of technique does it belong.[16 belong.[16 marks] 6. Write a program to sort the elements elements whose whose worst worst case is is O(n2) and average average case is O(n log n). [16 marks] 7. (a) Explain Explain selectio selection n sort sort indetai indetail. l. (b) Explain bubble sort indetail. [8+8] 8. Write an algorithm algorithm for routine merge(x,lb1,ub1, merge(x,lb1,ub1,ub2) ub2) that assumes that x[lb1] x[lb1] through 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 Explain Quick Quick sort sort with with algori algorithm. thm. (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 sort the elements of an array using using Quick sort with suitable suitable example. (b) What is the worst case and best case time complexity of the above program? 11. Write an algorithm for quick sort. sort. What is its time complexity. [16 marks] marks] 12. (a) Write an an algorithm for for selection 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 linear search delete the number number 26 from the list of numbers 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 Distinguish between linear linear and binary search methods. methods. (b) Write an algorithm for non-recursive binary search method. [8+8 marks] 15. (a) Write a C program to sort sort the elements of an array using using bubble sort technique 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 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 What is the time complexity of binary search? [16 marks] 18. (a) Write Write a C program program to merge two two sorted arrays arrays of integers. integers. (b) Derive the time complexity of merge sort. [8+8 marks] 19. (a) Write and explain non-recursive non-recursive algorithm algorithm for binary search with suitable 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]
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
20. Trace through through the steps by hand to sort the following following list in Quick sort. 28 7 39 3 63 13 61 17 50 21 [16 marks]
UNIT 7
1. What are are the advantages advantages and disadvantages disadvantages of stack ? Write a program to illustrate illustrate stack operation ? [16 marks] 2. Give an algorithm / C program program to to reverse a singly linked circular circular list inplace. inplace. [16 [16 marks] 3. What are are the advantages advantages and disadvantages disadvantages of stack ? Write a program to illustrate illustrate queue operation ? [16 marks] 4. Compare singly and and doubly linked list list to perform insertion operation . [16 marks] 5. Write a program to illustrate illustrate the the various operations operations of singly singly linked linked list . [16 marks] 6. Write a program to delete a node in singly singly and doubly doubly linked linked list . [16 marks] 7. Write a C program program using using pointers pointers to implemen implementt Queue with all all operation. operation. [16 marks] 8. Write Write a routine routine to concatena concatenate te two singly singly linked linked lists. lists. [16 marks] marks] 9. What is a stack? Explain two di erent representat representations ions of a stack. List the the operations operations performed on a stack and write wri te functions for implementing implemen ting these operations.[16 operation s.[16 marks] 10. (a) Write a 'C' Program to convert an infix expression expression into prefix expression (b) Transform the following expression to prefix, using the approach (A + B) * (C$(D E) + F) - G [8+8 marks marks]] 11. (a) Mention and explain explain various types of queues queues and give an example for each (b) Compare various types of queues. [8+8 marks] 12. Write an algorithm to perform 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 insertion and deletion algorithms algorithms for a doubly linked circular lists. [16 marks] 14. (a) Derive a method to convert a postfix expression expression into its prefix form (b) Consider the following following arithmetic arithmetic expression expression in postfix 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]
UNIT 8
1. (a) What What is a network? network? (b) What What is a spanning spanning tree? (c) Define Define minimal minimal spanning spanning tree tree . (d) What are the various traversals in a tree? [16 marks] 2. Write an algorithm to perform deletion operation operation in in a Binary Search Tree. Tree. [16 marks] 3. (a) Define Define multi multi graph graph and graph graph with with selfself- loop . (b) (b) Explain Explain connect connected ed graph graph with with example. [8+8 marks] 4. Explain Kruskal's method of determining determining the the minimal minimal spanning spanning tree. tree. [16 marks]
www.jntuworld.com
www.jntuworld.com
www.jwjobs.net
5. (a) Write Write a program to swap nodes nodes in a binary binary tree. (b) Write a program to find min min and max nodes in a binary tree. [8+8 marks] 6. Explain Explain binary binary search search tree tree operatio operations ns indetail indetail.. [16 marks] marks] 7. Explain non-recursive non-recursive and recursive algorithm for converse converse in order traversal traversal of binary tree. [16 marks] 8. Write a C program program for for creating, creating, inserting inserting and and deletion deletion in a Binary tree. [16 [16 marks] marks] 9. (a) Describe Describe di erent erent types of of trees. (b) Write a C program program to implement implement Binary Binary tree. tree. [6+10 marks] 10. (a) List and explain explain about the basic operations operations on a graph. (b) Write a C program program for depth first search of a graph. [7+9 marks] 11. Write a C program for creating, inserting inserting and deletion in a Binary tree. [16 marks] 12. (a) Write C function for minimum minimum spanning tree of a weighted undirected undirected graph (b) Write a C program to implement depth first traversal of graph. [10+6 marks] 13. (a) List and explain explain about the basic operations operations on a graph. (b) Write a C program program for depth first search of a graph. [7+9 marks] 14. Write and explain the breath first traversal traversal and depth first traversal traversal in a graph with algorithm. [8+8 marks] 15. Write in detail about the following: following: (a) Depth first search of a graph (b) Minimum spanning trees [8+8 marks] 16. (a) Define graph. Explain Explain the properties of a graph. (b) What is the di erence between strongly connected graph and weakly connected graph? [8+8 marks]
www.jntuworld.com