JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY, HYDERABAD
JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY, HYDERABAD B.Tech I PROGRAMMING FOR PROBLEM SOLVING Previous Question Paper (May - 2019 - R18)
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.
Name any two secondary storage devices and mention their characteristics.
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.
Why is it necessary to give the size of an array in an array declaration?
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.
Define the terms: Binary file and text file.
Answer
Sign in to view the complete answer paper.
How does a recursive function differ from an iterative function?
Answer
Sign in to view the complete answer paper.
Differentiate between selection sort and insertion sort.
Answer
Sign in to view the complete answer paper.
What is an operating system? List out its goals and functions.
Answer
Sign in to view the complete answer paper.
Mention the advantages and disadvantages of arrays.
Answer
Sign in to view the complete answer paper.
What is the purpose of feof( ) function?
Answer
Sign in to view the complete answer paper.
Write the syntax and purpose of malloc( ) function.
Answer
Sign in to view the complete answer paper.
Write an algorithm to find the maximum number in a given set.
Answer
Sign in to view the complete answer paper.
Part B
Answer any one full question from each unit.
Answer
Sign in to view the complete answer paper.
Answer
Sign in to view the complete answer paper.
Answer
Sign in to view the complete answer paper.
Answer
Sign in to view the complete answer paper.
Answer
Sign in to view the complete answer paper.
Answer
Sign in to view the complete answer paper.
Answer
Sign in to view the complete answer paper.
Answer
Sign in to view the complete answer paper.
Answer
Sign in to view the complete answer paper.
Answer
Sign in to view the complete answer paper.
Answer
Sign in to view the complete answer paper.
Answer
Sign in to view the complete answer paper.
Answer
Sign in to view the complete answer paper.
Answer
Sign in to view the complete answer paper.
Answer
Sign in to view the complete answer paper.
Answer
Sign in to view the complete answer paper.
Answer
Sign in to view the complete answer paper.
Answer
Sign in to view the complete answer paper.
Answer
Sign in to view the complete answer paper.
Answer
Sign in to view the complete answer paper.
Answer
Sign in to view the complete answer paper.
Answer
Sign in to view the complete answer paper.