JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD

JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD B.Tech I Year PROGRAMMING FOR PROBLEM SOLVING Previous Question Paper (November/December - 2020 - R18)

B.Tech | I Year | II Semester | R18 | November/December - 2020

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

Answer any five questions. All questions carry equal marks.

Main

115 marks
a

List and brief various bitwise operators available in C.

7 marks

Answer

Bitwise operators in C perform operations at the level of individual bits within an integer type. The available operators are:

  • Bitwise AND (&): Returns 1 if both corresponding bits are 1, otherwise returns 0.
  • Bitwise OR (|): Returns 1 if at least one of the corresponding bits is 1.
  • Bitwise XOR (^): Returns 1 if the corresponding bits are different (one is 0 and the other is 1).
  • Bitwise NOT (~): A unary operator that inverts all bits (flips 0s to 1s and 1s to 0s).
  • Left Shift (<<): Shifts the bit pattern to the left by a specified number of positions, filling the vacated right bits with 0.
  • Right Shift (>>): Shifts the bit pattern to the right by a specified number of positions. For unsigned types, it fills with 0; for signed types, behavior depends on the implementation (usually arithmetic shift).
b

Differentiate between while and do-while statements in C.

8 marks

Answer

The primary differences between the while and do-while loops are as follows:

Featurewhile loopdo-while loop
Entry conditionChecked before executing the loop body.Checked after executing the loop body.
Minimum iterationsZero; if the condition is false initially, the body never executes.At least one; the body executes once before the condition is checked.
Syntax structurewhile(condition) { ... }do { ... } while(condition);
UsageUsed when the number of iterations is unknown and the condition might be false initially.Used when the code block must execute at least once, such as in menu-driven programs.
215 marks
a

What is a dynamic array? Explain how to create and process a dynamic array with an example program.

7 marks

Answer

Sign in to view the complete answer paper.

b

What is the difference between an array and a string? Give examples.

8 marks

Answer

Sign in to view the complete answer paper.

3

List and explain various commonly used pre-processing directives in C with an example program.

15 marks

Answer

Sign in to view the complete answer paper.

415 marks
a

What is a function? Explain various ways of declaring, defining and invoking a function in C.

7 marks

Answer

Sign in to view the complete answer paper.

b

Write a C program to find the factorial of a number using recursive functions.

8 marks

Answer

Sign in to view the complete answer paper.

5

Devise an algorithm for bubble sort and explain with an illustration.

15 marks

Answer

Sign in to view the complete answer paper.

615 marks
a

Describe all the variants of two-way selection statements in C with clear syntax and example.

8 marks

Answer

Sign in to view the complete answer paper.

b

What is void statement? Why and when it is needed?

7 marks

Answer

Sign in to view the complete answer paper.

715 marks
a

What are self-referential structures? Give an example and its purpose.

7 marks

Answer

Sign in to view the complete answer paper.

b

How to pass an entire structure to a function? Illustrate with an example C program.

8 marks

Answer

Sign in to view the complete answer paper.

815 marks
a

Write the syntax of ftell( ) and rewind( ) functions in C and explain the same.

7 marks

Answer

Sign in to view the complete answer paper.

b

Discuss the significance of the file offset pointer when a file is read by different file handling functions.

8 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 MECT-MCT-MEM I Year II Semester, November/December - 2020, 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...