You are on page 1of 3

COMPUTER SCIENCE & ENGINEERING

CAMBRIDGE INSTITUTE OF TECHNOLOGY


Tatisilwai, Ranchi - 835103
SUBJECT: PPS

MODEL QUESTIONS
1. (a) Explain break and continue statement with example.
(b) Explain BITWISE operator with the help of example.
(c) Write a program in C to show the usage of relational operator.
(d) Explain switch case statement with suitable example.
(e) Explain the different looping statement in C.
(f) Differentiate between the while and do-while loop.
(g) Explain the logical operator with the help of example.

2. (a) Discuss different types of conditional statements in C with suitable examples.


(b) What are the parameter passing techniques available in C? Explain each of them
with the help of example.
(c) Write a program in C to swap two variables without using third variable. Write a
function for swapping the variables and call it within main function.

3. (a) What do understand by pointer? Explain different types of pointer with example.
(b) Write a program in C to store some numbers into an array and find the smallest
and largest number stored in the array using pointer.

4. (a) Apply the insertion Sort on the following Array elements. Also show the Array
after each step.
17 14 13 11 12 19 15

(b) Apply the Bubble sort on the following Array elements. Also show the Array after
each step.
17 11 19 12 13 8 15

(c) Apply the selection sort on the following Array elements. Also show the Array
after each step.
17 11 19 12 13 8 15

(d) Write a Program in C to merge two arrays of same size sorted in descending
order.

5. Write a program in c to print the following pattern in C


(a) *
**
***
****
(b) ****
***
**
*

(c) *
***
*****
*******

(d) 1
2 3 2
3 4 5 4 3
4 5 6 7 6 5 4

(e) 1
121
12321
1234321
13454321

6. (a) What do you understand by Fibonacci Series? Write a program in C to generate a


Fibonacci series up to 𝑛 numbers.
(b) What do you understand by Recursive function? What are the advantages and
disadvantages of recursion?
(c) Write a recursive program in C to find the factorial of a number.
(d) Write a program in C to implement Ackermann function using recursion.

7. (a) WAP in C to search an element in the array. If found display its index otherwise
display “Not found”.
(b) WAP in C to implement the binary search algorithm.

8. (a) Write a program in C to find sum and average of number in the array.
(b) Write a program in C to store some numbers into an array and find the smallest and
largest number stored in the array using pointer and function.

9. Design and develop a c program to add first n terms of the following series using a for loop:
(a) 1 + 1/2 + 1/3 + 1/4+· · ·
(b) 9 + 99 + 999 + 9999 + ⋯

10. (a) What do you understand by nested structure? Differentiate between structure
and union with the help of example.
(b) Write a program in C to read and display the information of 10 students like (roll no,
name, course etc.) using array of structure.
11. (a) Write a program in C to compare two strings without using library function.
(b) Write a program in C to copy one string to another string without using library
function.
(c) Write a program in C to find the length of a string without using library function.
(d) How String is represented in C language. Explain the following string functions with
the help of example:
Strnlen(), Strlen(), strcat(), strcmp() and strcpy()
(e) Write a program in C to copy last 𝑛 characters of a character array into another
character array.

12. (a) Write a program in C to store some number in a matrix and display the lower
triangular matrix.
(b) Write a program in C to store some number in a matrix and display the upper
triangular matrix.
(c) Write a program in C to display the diagonal elements of a matrix.
(d) Write a program in C to count the number of even and odd elements in the matrix.

You might also like