USHA RAMA College of Engineering & Technology

UNIT 1: 1. Write the various steps involved in executing a C program and illustrate it with the help of flow chart. 2. Give and explain the structure of a C program. 3. What are the general characteristics of C? 4. Write about space requirement for variable of different data type. 5. What is the different between signed integer and unsigned integer in terms of memory and range? 6. Name and describe the four data type qualifiers. To which data types can each qualifier be applied? 7. What are constants? Explain any four basic types of constants? 8. What is variable? How can variables be characterized? Give the rules for variable declaration? 9. What is an operator? Describe different types of operators that are included within the ‘C’ language with an example for each? 10. What are logical operators used in C? Illustrate with example? 11. What is an expression? What kind of information is represented by an expression? 12. What are the commonly used input functions in C? How are they accessed? 13. Summarize the standard escape sequences (special characters) in C. describe them. 14. Explain about different Define statements in C? 15. What is the purpose of switch statement? How does this statement differ form the other statements? 16. an electric power distribution company charges its domestic consumers as follows, Consumption units Rate of charge 0 -200 201-400 401-600 Rs. 0.50 per unit Rs.100 plus Rs.0.65 per unit excess 200 Rs.230 plus Rs.0.80 per unit excess 400

www.usharama.com

1

USHA RAMA College of Engineering & Technology

Write a ‘c’ program that reads the customer number and power consumed and prints the amount to be paid by the customer. 17. Write a ‘C’ program to print the Pascal’s triangle. 18. 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. UNIT 2: 1. What do you mean by function? Give the structure of the functions and explain about the arguments and their return values. 2. What is mean by function prototype? Give an example of function prototype. 3. Distinguish between function prototype and function definition. 4. What is the scope of variable of type: auto, register and static? 5. Why is it possible to use the same variable names for actual and formal arguments? 6. Distinguish between user-defined and built-in functions. 7. What is recursion? What is its advantage? 8. Write a recursive function power that when invoked return base exponent. 9. Explain in detail about pass by values and pass by reference. Explain with a simple program. 10. Write a recursive and non-recursive functions to find the factorial value for an integer. 11. What do you mean by the preprocessor? Explain different types of preprocessors in C? 12. What is the significance of conditional compilation? UNIT 3: Pointers: 1. What is a pointer? How is a pointer initiated? Given an example. 2. What is a pointer variable? How is a pointer variable different from ordinary variable? 3. If m and n have been declared as integers and p1 and p2 as pointers to integers, than find out the errors, if any in the following statements.

www.usharama.com

2

USHA RAMA College of Engineering & Technology
a. p1= &m; b. p2=n; c. m=p2-p1; d. *p1=&n; 4. State whether each of the following statement is true or false. Give reasons a. An integer can be added to a pointer. b. A pointer can never be subtracted from another pointer. c. When an array is passed as an argument to a function, a pointer is passed. d. Pointers cannot be used as formal argument to functions. 5. Write a C program that uses a pointer as a function argument. 6. Explain the process of accessing a variable through its pointer. Give an example. 7. How to use pointer variables in expression? Explain through example. 8. Write a C function using pointers to exchange the values stored in two locations in the memory. 9. Write a C program to illustrate use of indirection operator ‘*’ to access the value pointed by a pointer. 10. Write a C program to find factorial of given number using pointers. Arrays: 1. In what way array is different from an ordinary variable? 2. What conditions must be satisfied by the entire element of any given array? 3. What are subscripts? How are they written? What restrictions apply to the values that can be assigned to subscript? 4. What advantage is there in defining an array size in terms of a symbolic constant rather than a fixed integer quantity? 5. How are multidimensional array defined? Compare with the manner in witch one-dimensional arrays are defined? 6. 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. 7. Write a C program using pointer to read in an array of integer and print its element in reverse order.

www.usharama.com

3

USHA RAMA College of Engineering & Technology
8. Write a C program to compute the sum of all elements stored in an array using pointer. 9. Write a ‘C’ program to arrange the given list of numbers in ascending order using pointer. Strings: 1. Write a C program to sort the set of strings in an alphabetical order. 2. Write a C program to accept a string up to any termination character and count the number of blank spaces, lines and characters in the string. 3. Write a program to count the number of words, lines and characters in a text. 4. Write a C program to find number of words, blank spaces, special character, digit and vowels of a text using pointers. 5. Write a program to find the length of a given string by using pointer. 6. Write a ‘C’ program using pointer for string comparison. 7. Write a ‘C’ program to arrange the given names in alphabetical order using pointers. UNIT 4: 1. What is the use of a structure? Give an example for a structure with initialized value. 2. Describe nested structure. Draw diagram to explain nested structure. 3. When are array of structure used? Declare a variable as array of structure and initialize it. 4. Distinguish between an array of structures and array within a structure. Give an example each. 5. Explain the advantages of structure type over the array type variable? 6. How to compare structure variables? Give an example. 7. Explain the different ways of passing structure as arguments in function. 8. Write a C program to illustrate the method of sending an entire structure as a parameter to a function. 9. How structure elements are accessed using pointers? Which operator is used? Give an example.

www.usharama.com

4

USHA RAMA College of Engineering & Technology
10. Different between a structure and union with respective allocation of memory by the compiler. Give an example of each 11. Consider a structure master includes the information like name, code, pay, experience. Write a program to delete and display the information contained in master variable for a given code. 12. Define a structure to represent a data. Use your structures that accept to different dates in format mm-dd of the same year. And do the following: write a program to display the month names of both dates. 13. A company markets items. Create a structure “hwitem” that stores the title of the item, its price, an array of three floats so that it can record the sale in rupees of a particular item for the last three months, category of the item and it’s original equipment manufacturer. Write a short program that provides facility to read N numbers of item information, append new item and displays all record. 14. Write a C program using structure to create a library catalogue with the following fields: access number, author’s name, and title of the book, year of publication, publisher’s name and price. 15. Define 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. 16. Write a C program to print maximum marks in each subject along with the student name by using structure. Take 3 subjects and 3 student’s records. 17. Write a C program to calculate student-wise total for three students using array of structure. 18. Write a program to use structure within union. Display the content of structure elements. 19. Write a C program to add the two given complex numbers. Define function and print with pointers as argument. The complex number is a structure object with real and imaginary fields. 20. The annual examination is conducted for 50 students for three subjects. Write a program to read the data and determine the following,

www.usharama.com

5

USHA RAMA College of Engineering & Technology
a. Total marks obtained by each student. b. The highest marks in each subject and roll number of the student who secured it. c. The student who obtained the highest total marks. 21. Define a structure that represent a complex number (contains two floating members, called real and imaginary). Write a C program to add, subtract and multiply two complex numbers.
UNIT 5:

1. Distinguish between text mode and binary mode operations of a file. 2. Compare between printf and fprintf function. 3. What is purpose of getchar( ), putchar( ) function? How it is used in a C program? How is it different from getc( ) and putc( ) function? 4. Distinguish between getchar and scanf function for reading string? 5. Write a C program to read a text file and to count number of characters, Number of words, Number of sentences and write in an output file. 6. Write a C program to read last ‘n’ characters of the file using appropriate file function. 7. Write a C program to read a text file and convert the file contents in capital and write the contents in an outputs file. 8. Write a program to open a preexisting file and add information at the end of file. Display the contents of the file before and after appending. UNIT 6: 1. Write and explain linear search procedure with a suitable example. 2. Write a C program to search for a given element in the integer array using binary search. 3. Write and explain non-recursive algorithm for binary search with suitable example and discuss the various time complexities of binary search. 4. Suppose that the list contains the integers 1,2,….8 in the order. Trace through the steps of binary search to determine what comparisons of keys are done in searching. 5. Formulate recursive algorithm for binary search with its timing analysis.

www.usharama.com

6

USHA RAMA College of Engineering & Technology
6. Explain the algorithm for selection sort and give a suitable example. 7. Explain Quick sort with algorithm. 8. Trace through the steps by hand to sort the following list in Quick sort. 28 7 30 3 36 13 61 17 50 25. 9. Explain the algorithm for exchange sort with a suitable example. 10. Write a C program to sort the element of an array using tree sort method with suitable example. UNIT 7: 1. Define a data structure. What are the different types of data structures? Explain each of them with suitable example. 2. Write a C program to reverse the elements in a single linked list. 3. Write a function in C to combine two ordered lists into a single order list. 4. What is Circular doubly linked list? Explain the various operations on Circular doubly linked lists with suitable algorithms. 5. Write a C program to insert and delete the elements from circular doubly linked list. 6. What is a queue? Explain the various operations performed on queue with suitable algorithms. 7. Write a non-recursive simulation of Towers of Hanoi problem. 8. Use the operations push, pop stack top and empty to construct operations on stacks, which do each of the following. Give an integer n, set I to the nth element from top of stack, leaving the stack unchanged. Set I to the bottom element of stack, leaving the stack empty. 9. Declare a Queue of integers. Write functions to insert and delete an element from Queue. 10. Declare a circular Queue of integer such that F points to the front and R points to the rear write functions to insert and delete an element from queue. 11. Write a C program using pointers to implement a stack with all the operations. 12. What is the difference between linked list and an array. 13. Write a program to convert a given prefix expression to postfix expression using stacks.

www.usharama.com

7

USHA RAMA College of Engineering & Technology
14. Write a program to convert the infix expression into postfix expression. 15. Write a program to convert a given postfix expression to prefix expression using stacks. 16. Write a C program to evaluate the postfix expression. UNIT 8: 1. Formulate a non-recursive and recursive algorithm for converse inorder traversal of a binary tree. 2. Explain non-recursive and recursive algorithm for post-order traversal of binary tree. 3. Write an algorithm to count the number of leaf nodes in a binary tree. What is its computing time? 4. Write a C program to implement binary tree traversals. 5. Define graph. Explain the properties of a graph.

www.usharama.com

8

Sign up to vote on this title
UsefulNot useful

Master Your Semester with Scribd & The New York Times

Special offer for students: Only $4.99/month.

Master Your Semester with a Special Offer from Scribd & The New York Times

Cancel anytime.