JNTU

JNTU B.Tech I PROGRAMMING FOR PROBLEM SOLVING Previous Question Paper (September/October - 2021 - R18)

B.Tech | I | I-I | R18 | September/October - 2021

Answer PaperPaper Code: 151ACMaximum Marks: 75Time: 3 Hours

Answer any five questions

All questions carry equal marks

Main

115 marks
a

What is flow chart? Draw a flowchart to generate Fibonacci sequence up to ‘n’ numbers.

7 marks

Answer

A flowchart is a graphical representation of an algorithm or a step-by-step process used to solve a problem. It uses standardized symbols such as ovals for start/end, parallelograms for input/output, rectangles for processing, and diamonds for decision-making, connected by flow lines to indicate the sequence of operations.

To generate the Fibonacci sequence up to n numbers:

  1. Start.
  2. Read the value of n.
  3. Initialize variables: a = 0, b = 1, count = 0.
  4. If count is less than n, print a.
  5. Calculate next term: next = a + b.
  6. Update variables: a = b, b = next, count = count + 1.
  7. Repeat from step 4 until count equals n.
  8. Stop.
b

In C if any variable is auto storage class by default, then why auto keyword introduced in C? Explain.

8 marks

Answer

In C, the auto storage class is the default for all local variables defined within a function or block. The auto keyword was introduced primarily for historical reasons and to maintain compatibility with the B programming language, from which C evolved.

While it is redundant in modern C programming, the keyword serves specific purposes:

  • Explicit Documentation: It allows a programmer to explicitly declare the storage class of a variable, making the code's intent clear to others reading it, even if the compiler would have assumed it by default.
  • Consistency: It provides symmetry with other storage class specifiers like static, extern, and register. By using auto, the programmer can explicitly specify the storage class for every variable, ensuring a uniform coding style.
  • Future-proofing: In the C++ language, the meaning of auto was repurposed for type inference. Keeping the keyword in the C standard helps maintain a level of syntactical similarity between C and C++.
215 marks
a

What is an array? Write a ‘C’ program for Matrix Multiplication.

7 marks

Answer

Sign in to view the complete answer paper.

b

Write the use of Pointers in self-referential structures.

8 marks

Answer

Sign in to view the complete answer paper.

315 marks
a

Explain the basic operations performed on file.

7 marks

Answer

Sign in to view the complete answer paper.

b

What is the use of the preprocessor directives? Explain.

8 marks

Answer

Sign in to view the complete answer paper.

415 marks
a

Write a program to differentiate the structure and union memory allocations using size of function.

7 marks

Answer

Sign in to view the complete answer paper.

b

Explain the use of array of structures with an example program.

8 marks

Answer

Sign in to view the complete answer paper.

515 marks
a

Explain bubble sort with an example.

7 marks

Answer

Sign in to view the complete answer paper.

b

Give a brief note on insertion sort.

8 marks

Answer

Sign in to view the complete answer paper.

615 marks
a

Define Data type. Briefly discuss the fundamental data types supported in C.

7 marks

Answer

Sign in to view the complete answer paper.

b

How entry controlled loop is different from exit controlled loop? Explain.

8 marks

Answer

Sign in to view the complete answer paper.

715 marks
a

List the advantages of Pointers. Explain about pointers to structures.

7 marks

Answer

Sign in to view the complete answer paper.

b

Describe String library functions with syntax as well as example program.

8 marks

Answer

Sign in to view the complete answer paper.

815 marks
a

Explain recursion with an example program.

7 marks

Answer

Sign in to view the complete answer paper.

b

Write a note on dynamics memory allocation.

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 JNTU for B.Tech ME I I-I, September/October - 2021, 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...