Sunteți pe pagina 1din 5

CPDS IMPORTANT QUESTIONS UNIT I

THEORY 1. a)Define algorithm. Give the properties of algorithm. b) Define flowchart. What is the use of flowchart? List out various symbols used in flowchart. c) What are the different steps followed in the program development? 2. Give the block diagram of a computer and explain each unit in its hardware architecture. 3. Explain SDLC (Software Development Life Cycle) with an example. 4. a) Explain about computing environments b) Explain about computer languages PROGRAMS Give the algorithm and flowchart for the following: 1. checking whether a given number is prime or not 2. generate the Fibonacci sequence 3. factorial of a number 4. gcd of two numbers 5. finding the largest among 3 numbers 6. finding different types of roots(real,equal,complex) based on the discriminate of ax2+bx+c. 7. Find the Sum of Digits of a Positive Integer 8. reversing a number

UNIT II
1. 2.

3. 4. 5. 6. 7.

THEORY What are the general characteristics of C language? Explain the basic structure of a C program List the entire data types in C. What is the size of each of these data types? What is a variable? How can variables be characterized? Give the rules for variable declaration Describe the operators supported in C with an example each. Explain various conditional statements in C with examples Explain various loop control structures in C with examples Write short notes on a) Type conversions b) break c) continue d) precedence and associativity

PROGRAMS Write a C program for the following: 1. Roots of a quadratic equation based on discriminate 2. to find the factorial of a given number 3. to generate the Fibonacci sequence 4. Find the sum of individual digits of a number 5. To check whether a number is palindrome are not 6. To find the sum of the series sum= 1 + x2/2! + x4/4! ++ xn/n! 7. total and sum of all even and odd integers in a given set of 20 integers 8. To check whether a number is amstrong number or not 9. To generate the following sequence 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5

UNIT III
THEORY 1. Define function. Give the advantages of functions and explain various categories of functions with examples. 2. Explain various storage classes in C 3. Explain all preprocessor directives in C. 4. Define an array. Give the syntax for declaration, accessing and printing i. One-dimensional array ii. Two-dimensional array iii. Multi-dimensional array PROGRAMS Write a C program for the following: 1. To find sum and average of given N elements in an array 2. To print given array in reverse order 3. To find the sum of 2 matrices 4. To find the product of 2 matrices 5. To find the factorial of a number using functions a. Without arguments & without return value b. With arguments and without return value c. With arguments and with return value 6. To add, subtract ,multiply and divide two complex numbers (x+iy) and (a+ib) using functions

UNIT IV
THEORY 1. Define a pointer. What are the various operations performed on pointers. Explain with an example. 2. Explain in detail about pass by value and pass by reference. 3. Explain various legal and illegal operations on pointers with examples. 4. Explain all the string I/O functions. Give the syntax. 5. Explain various string handling functions with examples. 6. a) Explain about command line arguments b) Explain about dynamic memory management functions in C with examples. PROGRAMS Write a C program for the following: 1. To access variables through pointers 2. To swap 2 numbers using call by value and call by reference 3. To find factorial of a given number using pointers 4. To find the smallest element of an array using pointers 5. To reverse the string using pointers 6. To find the length of the string using pointers

UNIT V
THEORY 1. What is a structure? Give its advantage. Give an example of creating and accessing members of a structure. 2. Explain different ways of passing structure as arguments to functions. Write C programs to illustrate these methods. 3. a) List out the differences between structures and unions b) What is a self referential structure? What kind of applications uses this? Give an example 4. Explain the following concepts in C a) typedef b) bit fields c)enumerated datatypes PROGRAMS Write a C program for the following: 1. To assign some values to the members of a structure and display the same on the screen.( Members include the student name, roll number and marks) 2. To illustrate the concept of nested structures

3. To find the total and average of sales of all employees using array of structures. 4. To implement a union for various fields name, num and average of a student.

UNIT VI
THEORY 1. Explain the way of defining, opening and closing a file. Also explain the different modes of operation 2. Distinguish between text mode and binary mode operation of a file. 3. Elaborate file handling functions in C with the help of sample code 4. a)Explain about error handling in files b) Explain random access to files in C PROGRAMS Write a C program for the following: 1. To read student data from keyboard, write it to a file and display the contents on the screen. 2. To copy the contents of one file into another. 3. To read numbers from a file DATA, contains a series of integer numbers and then write all odd numbers to a file to be called ODD and all even numbers to a file to be called EVEN.

UNIT VII
THEORY 1. Explain the working of linear search with an example 2. Explain the working of binary search with an example. 3. Explain bubble sort with an example. 4. Explain selection sort with an example 5. Explain insertion sort with an example 6. Explain quick sort with an example. 7. Explain merge sort with an example. PROGRAMS Write a C program for the following: 1. To sort given set of N numbers using Bubble sort 2. To sort given set of N numbers using selection sort 3. To sort given set of N numbers using insertion sort 4. To sort given set of N numbers using quick sort 5. To sort given set of N numbers using merge sort 6. To implement sequential search

7. To implement binary search using iterative method 8. To implement binary search using recursion

UNIT VIII
THEORY 1. Define a data structure. What are the different types of data structures? Explain each of them with suitable examples. 2. Define stack. Explain various operations on stack with an example. 3. Write an algorithm to convert infix expression into postfix form. Illustrate the algorithm using a suitable example. 4. Write an algorithm to for evaluating a postfix expression. Illustrate the algorithm using a suitable example. 5. Define queue. Explain various operations on queue with an example 6. What is a single linked list? Explain various operations on single linked list. PROGRAMS Write a C program for the following: 1. To implement the following operations in a stack a. Push b. Pop c. Display the elements of stack 2. To convert infix expression into postfix using stack 3. For evaluation of a postfix expression using stack 4. To implement linear queue using arrays 5. To implement stack using linked lists 6. To implement queue using linked lists 7. To implement single linked list and perform the following operations a. insertion b. deletion c. display

S-ar putea să vă placă și