JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD
JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD B.Tech I Year PROGRAMMING FOR PROBLEM SOLVING Previous Question Paper (January/February - 2024 - R22)
Part-A is compulsory. Part-B consists of ten questions (2-11) carrying 10 marks each. Answer one question from each unit.
Part A
Answer all sub-questions:
List bitwise operators in C.
Answer
Bitwise operators in C are used to perform operations at the level of individual bits. They are:
- &: Bitwise AND
- |: Bitwise OR
- ^: Bitwise XOR
- ~: Bitwise NOT (One's complement)
- <<: Left shift
- >>: Right shift
What is the purpose of type conversion?
Answer
The purpose of type conversion (also known as type casting) is to convert a value from one data type to another. It ensures that operations involving mixed data types (e.g., adding an integer to a float) can be performed by the compiler by making the operands compatible, thereby preventing data loss or logical errors during evaluation.
What is an array?
Answer
Sign in to view the complete answer paper.
What is the significance of the strcpy function?
Answer
Sign in to view the complete answer paper.
What is the purpose of the preprocessor in C?
Answer
Sign in to view the complete answer paper.
How can you check if a file exists before opening it in C?
Answer
Sign in to view the complete answer paper.
What is a function prototype?
Answer
Sign in to view the complete answer paper.
Define the term "function signature".
Answer
Sign in to view the complete answer paper.
What is the time complexity of bubble sort?
Answer
Sign in to view the complete answer paper.
What is the main advantage of binary search over linear search?
Answer
Sign in to view the complete answer paper.
Part B
Write an algorithm for finding the roots of a quadratic equation.
Answer
Sign in to view the complete answer paper.
Discuss the importance of flowchart and pseudocode in designing algorithm.
Answer
Sign in to view the complete answer paper.
Describe the different storage classes available in C.
Answer
Sign in to view the complete answer paper.
Explain various types of errors with examples.
Answer
Sign in to view the complete answer paper.
Explain how to define and use an enumeration data type in C.
Answer
Sign in to view the complete answer paper.
Compare character arrays and string literals. How are strings handled as arrays of characters in C?
Answer
Sign in to view the complete answer paper.
Describe the process of creating and initializing a one-dimensional array. Give an example.
Answer
Sign in to view the complete answer paper.
Discuss the use of pointers in self-referential structures.
Answer
Sign in to view the complete answer paper.
Write a C program to check the end-of-file condition using the feof function.
Answer
Sign in to view the complete answer paper.
Compare and contrast the #ifdef and #ifndef directives in C.
Answer
Sign in to view the complete answer paper.
Differentiate between text and binary file modes in C.
Answer
Sign in to view the complete answer paper.
Write a program to append data to an existing text file in C.
Answer
Sign in to view the complete answer paper.
Describe memory allocation and de-allocation using malloc() and free() functions. Write suitable example program.
Answer
Sign in to view the complete answer paper.
Explain call by reference mechanism with an example.
Answer
Sign in to view the complete answer paper.
Write a C program to calculate the factorial of a given number using recursion.
Answer
Sign in to view the complete answer paper.
Explain the binary search algorithm in detail. Provide an example.
Answer
Sign in to view the complete answer paper.
Explain the key steps involved in the Insertion sort algorithm with an example.
Answer
Sign in to view the complete answer paper.