JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY, HYDERABAD

JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY, HYDERABAD B.Tech I PROGRAMMING FOR PROBLEM SOLVING Previous Question Paper (May - 2019 - R18)

B.Tech | I | I-II | R18 | May - 2019

Answer PaperPaper Code: 152AFMaximum Marks: 75Time: 3 hours

Note: This question paper contains two parts A and B. Part A is compulsory. Part B consists of 5 Units. Answer any one full question from each unit.

Part A

Answer all questions. Each question carries marks as indicated.

1a

Name any two secondary storage devices and mention their characteristics.

2 marks

Answer

Two common examples of secondary storage devices are the Hard Disk Drive (HDD) and the Solid State Drive (SSD). Their characteristics are as follows:

  • Hard Disk Drive (HDD): This device uses magnetic storage technology with rotating platters and read/write heads. It is characterized by high storage capacity at a relatively low cost per gigabyte, though it is susceptible to mechanical failure and has slower access speeds compared to modern alternatives.
  • Solid State Drive (SSD): This device utilizes NAND-based flash memory to store data. It is characterized by significantly faster read/write speeds, lower power consumption, and higher durability due to the absence of moving mechanical parts, making it ideal for performance-oriented computing environments.

Both devices are non-volatile, meaning they retain stored data even when the power supply is disconnected, which distinguishes them from primary memory like RAM.

1b

Why is it necessary to give the size of an array in an array declaration?

2 marks

Answer

In C, the size of an array must be specified at the time of declaration to allow the compiler to perform static memory allocation. When an array is declared, the compiler must determine the exact amount of contiguous memory space to reserve in the data segment or stack frame for that variable.

  • Memory Reservation: The compiler calculates the total memory required by multiplying the number of elements by the size of the data type. For example, an array of 10 integers requires
    10 × sizeof(int)
    bytes.
  • Address Calculation: Knowing the size allows the compiler to establish the base address and calculate the memory offset for any index. Without a fixed size, the compiler cannot determine the bounds of the array, which would make it impossible to prevent buffer overflows or manage memory safely.
  • Type Consistency: In C, the size is considered part of the array's type information. This ensures that the program has a predictable memory layout, which is essential for efficient execution and pointer arithmetic.
1c

Define the terms: Binary file and text file.

2 marks

Answer

Sign in to view the complete answer paper.

1d

How does a recursive function differ from an iterative function?

2 marks

Answer

Sign in to view the complete answer paper.

1e

Differentiate between selection sort and insertion sort.

2 marks

Answer

Sign in to view the complete answer paper.

1f

What is an operating system? List out its goals and functions.

3 marks

Answer

Sign in to view the complete answer paper.

1g

Mention the advantages and disadvantages of arrays.

3 marks

Answer

Sign in to view the complete answer paper.

1h

What is the purpose of feof( ) function?

3 marks

Answer

Sign in to view the complete answer paper.

1i

Write the syntax and purpose of malloc( ) function.

3 marks

Answer

Sign in to view the complete answer paper.

1j

Write an algorithm to find the maximum number in a given set.

3 marks

Answer

Sign in to view the complete answer paper.

Part B

Answer any one full question from each unit.

210 marks
a
What is precedence and associativity in an expression? What is their need?
4 marks

Answer

Sign in to view the complete answer paper.

b
Write down the significance of break statement inside a switch statement.
3 marks

Answer

Sign in to view the complete answer paper.

c
Discuss the concept of type conversion in C.
3 marks

Answer

Sign in to view the complete answer paper.

OR
310 marks
a
What are command-line arguments? Explain briefly.
5 marks

Answer

Sign in to view the complete answer paper.

b
List and explain various storage classes available in C and state the reason why register storage classes are less frequently used.
5 marks

Answer

Sign in to view the complete answer paper.

410 marks
a
What is a multidimensional array? Explain how a multidimensional array is defined in terms of a pointer to a collection of contiguous arrays of lower dimensionality.
4 marks

Answer

Sign in to view the complete answer paper.

b
Differentiate between structure and union in C.
3 marks

Answer

Sign in to view the complete answer paper.

c
Write down the applications of using arrays.
3 marks

Answer

Sign in to view the complete answer paper.

OR
510 marks
a
Write and explain the general format for declaring and accessing members of a structure.
5 marks

Answer

Sign in to view the complete answer paper.

b
How to use pointers as arguments in a function? Explain with a program.
5 marks

Answer

Sign in to view the complete answer paper.

6
List and explain various file read/write functions available in C with examples illustrating their usage and implementation.
10 marks

Answer

Sign in to view the complete answer paper.

OR
710 marks
a
Write the syntax of fseek( ) function in C and explain the same.
5 marks

Answer

Sign in to view the complete answer paper.

b
Explain the concept of streams and their significance in I/O operations.
5 marks

Answer

Sign in to view the complete answer paper.

810 marks
a
Explain the call-by-value and call-by-reference parameter passing methods.
5 marks

Answer

Sign in to view the complete answer paper.

b
Write a C program to generate Fibonacci series using recursive functions.
5 marks

Answer

Sign in to view the complete answer paper.

OR
910 marks
a
State the need for user-defined functions.
5 marks

Answer

Sign in to view the complete answer paper.

b
List and explain the functions used to allocate and free memory dynamically.
5 marks

Answer

Sign in to view the complete answer paper.

1010 marks
a
Devise an algorithm for linear search and explain with an illustration.
5 marks

Answer

Sign in to view the complete answer paper.

b
Write a C program to determine whether a given number is prime or not.
5 marks

Answer

Sign in to view the complete answer paper.

OR
1110 marks
a
Devise an algorithm for selection sort and explain with an illustration.
4 marks

Answer

Sign in to view the complete answer paper.

b
Give a brief note on asymptotic notations.
3 marks

Answer

Sign in to view the complete answer paper.

c
Mention the complexity of linear search and binary search algorithms.
3 marks

Answer

Sign in to view the complete answer paper.

About this paper

This page contains the question paper of PROGRAMMING FOR PROBLEM SOLVING from JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY, HYDERABAD for B.Tech ECE I I-II, May - 2019, R18.

For the solved question paper with answers, switch to the Answer Paper tab.

Other papers in PROGRAMMING FOR PROBLEM SOLVING

Loading Question Papers

Fetching data from database...