JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD
JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD B.Tech I Year COMPUTER PROGRAMMING Previous Question Paper (January/February - 2024 - R15)
Note: i) Question paper consists of Part A, Part B. ii) Part A is compulsory, which carries 25 marks. In Part A, answer all questions. iii) In Part B, Answer any one question from each unit. Each question carries 10 marks and may have a, b as sub questions.
Part A
Differentiate between a variable and a constant.
Answer
A variable is a named storage location in memory whose value can be changed during program execution. A constant is a fixed value that does not change throughout the execution of the program once it is defined.
Discuss the differences between the pre-increment and post-increment operators in C. Give examples for both of them.
Answer
In pre-increment (++a), the value of the variable is incremented before it is used in the expression. In post-increment (a++), the current value of the variable is used in the expression first, and then the variable is incremented.
Example: If a = 5, then b = ++a results in b = 6 and a = 6. Conversely, b = a++ results in b = 5 and a = 6.
Discuss the role of the #define directive in the preprocessor.
Answer
Sign in to view the complete answer paper.
What is a user-defined function in C? Provide an example?
Answer
Sign in to view the complete answer paper.
Explain the concept of the address-of operator (&) in relation to pointers.
Answer
Sign in to view the complete answer paper.
Explain the purpose of malloc() function in dynamic memory allocation.
Answer
Sign in to view the complete answer paper.
Discuss the role of the file pointer in file handling.
Answer
Sign in to view the complete answer paper.
Define an enumerated type in C. Provide an example of its usage.
Answer
Sign in to view the complete answer paper.
Write the time complexity of selection sort and bubble sort.
Answer
Sign in to view the complete answer paper.
Define a linear list and explain its significance in data structures.
Answer
Sign in to view the complete answer paper.
Part B
Compare and contrast the if and switch statements in C.
Answer
Sign in to view the complete answer paper.
Explain Bit-wise operators in C. Evaluate the bitwise AND operation for the given expression: a = 5 & 3.
Answer
Sign in to view the complete answer paper.
Write a C program to display the first 10 natural numbers using a while loop.
Answer
Sign in to view the complete answer paper.
Explain the difference between for and while loops.
Answer
Sign in to view the complete answer paper.
Explain the difference between a function declaration and a function definition. Write the significance of function prototypes in C.
Answer
Sign in to view the complete answer paper.
Write a recursive function to calculate the factorial of a number.
Answer
Sign in to view the complete answer paper.
When and where is the extern storage class typically used in C?
Answer
Sign in to view the complete answer paper.
Write a program to transpose a matrix using arrays in C.
Answer
Sign in to view the complete answer paper.
How are pointers used for inter-function communication in C?
Answer
Sign in to view the complete answer paper.
How can pointers be used to traverse an array?
Answer
Sign in to view the complete answer paper.
Discuss the difference between a character array and a string in C.
Answer
Sign in to view the complete answer paper.
Write a program that finds the length of a string without using the strlen() function.
Answer
Sign in to view the complete answer paper.
Explain the advantages and limitations of using bit fields.
Answer
Sign in to view the complete answer paper.
Write a program that uses structures to represent a book with title, author, and publication year.
Answer
Sign in to view the complete answer paper.
Write a C program that copies the contents of one binary file to another.
Answer
Sign in to view the complete answer paper.
Enumerate the key differences between text and binary file formats in C.
Answer
Sign in to view the complete answer paper.
Compare queues with stacks, highlighting their differences.
Answer
Sign in to view the complete answer paper.
Discuss the applications of stacks.
Answer
Sign in to view the complete answer paper.
Explain how to insert a new node at the end of a singly linked list.
Answer
Sign in to view the complete answer paper.
Discuss the conditions under which binary search is effective.
Answer
Sign in to view the complete answer paper.