Cse Pps Question Bank (24-25) For Mid2
Cse Pps Question Bank (24-25) For Mid2
3C-9 Which of the following file modes open a file in the write state for updating I CO4
(a )
a) Ab b) wb
c ) rb d) r+b
3C-10 The first and second arguments of fopen() are (a ) CO4
a). A character string containing the name of the file & the second argument is the
mode
b) A character string containing the name of the user & the second argument is the I
mode
c) A character string containing file pointer & the second argument is the mode
d) None of the mentioned
3C-11 Which function is used to position a file at the beginning I CO4
(b )
a) ftell b) fseek
c) freport d) feof
3C-12 What are the C functions used to read or write a file in Text Mode.? (a ) II CO4
a) fprintf(),fscanf(); b) fread(),fwrite();
fprint(),fscan(); d)read(),write()
3C-13 which Is data type of file pointer is? ( d) II CO4
a) Yes
b) No
c) May Be
d) Can't Say
3F-10 If there is any error while opening a file, fopen will return--NULL---- I CO4
3F-12 For Binary files a ------b-------------------- must be appended to the mode string. II CO4
3F-13 When fopen() is not able to open a file returns-------NULL--------------- III CO4
3F-15 EOF() is an integer type define stdio.h and has a value--<1------------ III C04
5- MARK QUESTIONS
3D-7 Differentiate between Conditional Compilation and Conditional Branching CO3
IV
statements?
3D-8 Develop a ‘C program to write contents of one file in reverse into another file? CO4
I
3D-9 Write a C program to read an email address from user using scanf function. The code V CO4
should accept only email addresses and store user name and domain name separately.
(Eg if user supplies [email protected] username is xyz and domain name is gmail.com)
3D-10 Develop a ‘C program to combine contents of two files in a third file and display CO4
IV
the data from third file?
3D-11 Explain about Random Access using fseek , ftell and rewind functions? III CO4
SRI INDU COLLEGE OF ENGG & (Regulation :R22)
TECH QUESTION BANK Prepared
on :12/10/2022 Rev1:
(Regulation :R22) 1/10/2024
Department of Computer Science and Engineering Page: 3 of 7
Sub. Code & Title (R22CSE1113) PROGRAMMING FOR PROBLEM SOLVING
Academic Year: 2024-25 Year/Sem. I-I/CSE(A,B,C,D&E),IT,AIML(A,B,C,&D)),
CS(A&B),CSIT,DS(A&B&C),AI&DS
Faculty Name & Designation Dr P RAMESHKUMAR\ D MOUNIKA \K S ARCHANA\
CH.SHRAVANI P.MANASA\G.LAVANYA\CHITTY\SWAPNA\
MEGHAMLA\T.SIRISHA
3D-12 Write a program to open the file in read mode and append the content to it IV CO4
3D-14 Write a program to read name and marks of N number of students and store them in a IV CO4
text file.
3D-15 Compare I/O operations on text file and binary file using structures? CO4
II
a) Pass By Value copies the variable value in one more memory location
b) Pass By Value does not use Pointers
c) Pass By Value protects your source or original variables from changes in outside
functions or called functions
d) All the above
4C-5 To tell the compiler to store data at an address, use the
I CO5
( D )
a) Address operator(&) b) Array operator([])
c) Dereference operator(#) c) Indirection operator(*)
SRI INDU COLLEGE OF ENGG & (Regulation :R22)
TECH QUESTION BANK Prepared
on :12/10/2022 Rev1:
(Regulation :R22) 1/10/2024
Department of Computer Science and Engineering Page: 4 of 7
Sub. Code & Title (R22CSE1113) PROGRAMMING FOR PROBLEM SOLVING
Academic Year: 2024-25 Year/Sem. I-I/CSE(A,B,C,D&E),IT,AIML(A,B,C,&D)),
CS(A&B),CSIT,DS(A&B&C),AI&DS
Faculty Name & Designation Dr P RAMESHKUMAR\ D MOUNIKA \K S ARCHANA\
CH.SHRAVANI P.MANASA\G.LAVANYA\CHITTY\SWAPNA\
MEGHAMLA\T.SIRISHA
4C-15 If malloc() and calloc() are not type casted, the default return type is _____ ( C )
III CO5
(a) void*
(b) void**
(c) int*
(d) char*
4F-2
The parameters in a function definition are called---FORMAL----------- I CO5
4F-3
In function free(p), p is a –P IS POINTER----------------- I CO5
4F-11 The CALLOC_____ library function allocates a specified number of bytes and
initializes them to zero. I CO5
5 MARK QUESTIONS
4D-1. Explain about recursive function with an example? II CO5
4D-2. Construct a program to find factorial of a given number?
III CO5
4D-3. Explain about dynamic memory allocation? II CO5
4D-4 Implement a recursive function to print the numbers in Fibonacci series?
III CO4
4D-5. Discuss about the following with an example . III CO5
4D-14 Explain the standard library functions in c along with its advantages and disadvantages?
II CO5
4D-15
IV CO5
Write a program to find sum of first n natural numbers using recursion?
5C-11 The given array is arr = {1, 2, 4, 3}. Bubble sort is used to sort the array elements. I CO6
How many iterations will be done to sort the array?
( B )
a) 4 b) 2
c) 1 d) 0
5C-12 Which of the following algorithm pays the least attention to the ordering of the I CO6
elements in the input list?
( A )
a) Insertion sort b) Selection sort
c) Quick sort d) None
5C-13 Linear search is also called------ ( B )
I CO6
a)Random search
b)Sequential Search
c)Perfect search
d)None
5C-14 If the given input array is sorted or nearly sorted, which of the following algorithm I CO6
gives the best performance? ( A )
5M-4 Match the best case time complexity notations III CO6
a) bubble sort 2 i) O(1)
b) binary search 4 ii) O(n)
c) linear search 1 iii)O(N2)
5- MARK QUESTIONS
5D-1
Explain Linear search technique with example.? II CO6
5D-2 Explain Binary search technique with example? II CO6
5D-3 Develop a C program on Bubble sort?
III CO6
5D-4 Implement a C program on Insertion sort? III CO6
5D-5 Construct a C program on Selection sort. And Explain with an
example? III CO6
5D-11 Why sorting algorithm are important explain with an example? III CO6
5D-12 Define time complexity and space complexity and write all the time and space III CO6
complexity of searching and sorting.
5D-13 Difference between insertion sort and selection sort III CO6
5D-14 Write a program for binary search using recursion. IV CO6
5D-15 Difference between linear and binary search III CO6