JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD

JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD B.Tech I Year PROGRAMMING FOR PROBLEM SOLVING Previous Question Paper (September - 2023 - R22)

B.Tech | I Year | I-I | R22 | September - 2023

Answer PaperPaper Code: 181APMaximum Marks: 60Time: 3 Hours

Part-A is a compulsory question which consists of ten sub-questions from all units carrying equal marks. Part-B consists of ten questions (numbered from 2 to 11) carrying 10 marks each. From each unit, there are two questions and the student should answer one of them. Hence, the student should answer five questions from Part-B.

Part A

110 marks
a

What is compiler?

1 marks

Answer

A compiler is a special type of program that translates source code written in a high-level programming language (like C, C++, Java) into a lower-level language, typically machine code or bytecode, that a computer's processor can understand and execute. It performs this translation in a single pass or multiple passes, checking for errors in syntax and semantics along the way. If errors are found, the compiler reports them to the programmer. If the code is error-free, it generates an executable file or object code.

b

Give one example for syntax error.

1 marks

Answer

A syntax error occurs when the source code violates the grammatical rules of the programming language. For example, forgetting to close a semicolon at the end of a statement in C is a common syntax error. Another example is misspelling a keyword, such as writing 'whlie' instead of 'while'.

Example:

int main() { printf("Hello World") }

In this example, the closing curly brace `}` for the `main` function is missing, which is a syntax error.

c

Define the enumeration data type in C.

1 marks

Answer

Sign in to view the complete answer paper.

d

What is a two-dimensional array?

1 marks

Answer

Sign in to view the complete answer paper.

e

How do you define a macro using the preprocessor?

1 marks

Answer

Sign in to view the complete answer paper.

f

How do you append data to an existing file in C?

1 marks

Answer

Sign in to view the complete answer paper.

g

What is recursion?

1 marks

Answer

Sign in to view the complete answer paper.

h

What is the signature of a function?

1 marks

Answer

Sign in to view the complete answer paper.

i

What is the key difference between linear search and binary search?

1 marks

Answer

Sign in to view the complete answer paper.

j

What is the time complexity of selection sort?

1 marks

Answer

Sign in to view the complete answer paper.

Part B

210 marks
a

Differentiate between object code and executable code in the context of compiling a program.

5 marks

Answer

Sign in to view the complete answer paper.

b

Discuss the different storage classes in C programming.

5 marks

Answer

Sign in to view the complete answer paper.

OR
310 marks
a

Discuss the different types of loops in C programming.

5 marks

Answer

Sign in to view the complete answer paper.

b

How can you pass command line arguments to a C program? Provide a step-by-step explanation.

5 marks

Answer

Sign in to view the complete answer paper.

410 marks
a

Differentiate between a null-terminated string and a fixed-length string.

5 marks

Answer

Sign in to view the complete answer paper.

b

Discuss the concept of a union and how it differs from a structure.

5 marks

Answer

Sign in to view the complete answer paper.

OR
5

Discuss the significance of pointers in programming and provide examples of their practical usage in manipulating data.

10 marks

Answer

Sign in to view the complete answer paper.

610 marks
a

Compare and contrast text files and binary files in terms of their structure and usage.

5 marks

Answer

Sign in to view the complete answer paper.

b

Write a C program to read a text file line by line and display its contents on the console.

5 marks

Answer

Sign in to view the complete answer paper.

OR
710 marks
a

Describe the purpose of conditional compilation directives like #ifdef, #ifndef, and #endif in C.

5 marks

Answer

Sign in to view the complete answer paper.

b

Write a C program to read a text file and count the number of lines in it.

5 marks

Answer

Sign in to view the complete answer paper.

810 marks
a

Explain the process of freeing memory in C. What happens if memory is not freed after allocation?

5 marks

Answer

Sign in to view the complete answer paper.

b

Discuss the limitations of recursive functions. What factors should be considered before using recursion?

5 marks

Answer

Sign in to view the complete answer paper.

OR
9

Describe the concept of passing parameters to functions in C with example programs.

10 marks

Answer

Sign in to view the complete answer paper.

1010 marks
a

Write an algorithm for binary search and implement with an example.

5 marks

Answer

Sign in to view the complete answer paper.

b

Define Big O notation and explain its significance in analyzing algorithm efficiency.

5 marks

Answer

Sign in to view the complete answer paper.

OR
11

Explain the bubble sort algorithm step by step with an example.

10 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 AE I Year I-I, September - 2023, R22.

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...