Programming for Problem Solving - B.Tech 2nd Semester Examination, 2025
Programming for Problem Solving
Instructions:
- The marks are indicated in the right-hand margin.
- There are NINE questions in this paper.
- Attempt FIVE questions in all.
- Question No. 1 is compulsory.
-
The correct syntax for an if-statement is
-
C function execution always begins from
-
Which storage class has the default value of a variable as zero?
-
Relational operators always return
-
Which of the following is an exit-controlled loop?
-
Binary search works only on
-
break keyword is used to
-
In a union, memory allocated is equal to the size of
-
fopen("abc.txt","r") opens file in
-
Which of the following problems can be solved using recursion?
-
Write an algorithm and draw the flowchart for checking whether a number is prime or not.
-
Differentiate between syntax errors, logical errors, compile-time errors, and run-time errors. Provide suitable examples.
-
Explain function declaration, definition, and calling conventions in C. Discuss call by value and call by reference with examples.
-
Differentiate between while and do-while loop construct. Write a program for generating Fibonacci series using loop.
-
Write the differences between if, if-else, and switch statements with examples.
-
Explain the use of break, continue, and goto statements with examples.
-
How are arrays declared and initialized in C? What is bound checking? Why is it important in array programming?
-
What is recursion? Explain how recursion works with stack memory. Write a recursive program for finding the factorial of a number.
-
Write a program to perform linear search in an array. Also find its complexity in Best, Average and Worst cases.
-
Describe the selection sort algorithm and implement it in C language.
-
Explain various storage classes in C with proper examples.
-
Write a program to copy the contents of one file into another and explain each step of file IO.
-
Explain arithmetic, relational, logical, bitwise and assignment operators in C along with their precedence rules and examples.
-
What is the difference between structure and union? Explain with an example.