JNTU

JNTU B.Tech I Year PROGRAMMING FOR PROBLEM SOLVING Previous Question Paper (December – 2018 - R18)

B.Tech | I Year | I-I | R18 | December – 2018

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

Note: This question paper contains two parts A and B. Part A is compulsory which carries 25 marks. Answer all questions in Part A. Part B consists of 5 Units. Answer any one full question from each unit. Each question carries 10 marks and may have a, b, c as sub questions.

Part A

1a

What is a flowchart? Explain with one example.

2 marks

Answer

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

For example, a flowchart to determine if a number is even or odd begins with a Start symbol, followed by an input step to read the number. A decision diamond checks if the number modulo 2 equals zero. If true, the flow leads to an output of 'Even'; if false, it leads to an output of 'Odd', both finally connecting to an End symbol.

1b

Discuss about Strlen() function with an example.

2 marks

Answer

The strlen() function is a standard library function in C, defined in the string.h header file, used to calculate the length of a null-terminated string. It counts the number of characters in a string excluding the null terminator ('\0').

The syntax is size_t strlen(const char *str);, where it returns the length as an unsigned integer of type size_t.

Example:

#include <stdio.h>
#include <string.h>

int main() {
    char str[] = "Hello";
    printf("Length: %zu", strlen(str)); // Outputs: Length: 5
    return 0;
}
1c

Explain fseek() function with example.

2 marks

Answer

Sign in to view the complete answer paper.

1d

Explain about the parameter passing using copy by address.

2 marks

Answer

Sign in to view the complete answer paper.

1e

Write an algorithm to find the given number is prime or not.

2 marks

Answer

Sign in to view the complete answer paper.

1f

C is a structured programming language? Justify.

3 marks

Answer

Sign in to view the complete answer paper.

1g

How pointer can be used for accessing multi dimensional arrays? Discuss.

3 marks

Answer

Sign in to view the complete answer paper.

1h

Name few preprocessor directives.

3 marks

Answer

Sign in to view the complete answer paper.

1i

Write Recursive function for towers of honoi.

3 marks

Answer

Sign in to view the complete answer paper.

1j

Find out no. of comparisons to sort {2,1,7,4,8,6}.

3 marks

Answer

Sign in to view the complete answer paper.

Part B

210 marks
a

Describe the various control structures available in ‘C’.

5 marks

Answer

Sign in to view the complete answer paper.

b

Write a program to find whether the given no is am strong or not.

5 marks

Answer

Sign in to view the complete answer paper.

OR
310 marks
a

Explain about different bit-wise operators with examples.

5 marks

Answer

Sign in to view the complete answer paper.

b

What are command line arguments? Explain with a complete ‘C’ program.

5 marks

Answer

Sign in to view the complete answer paper.

410 marks
a

Explain about Enumerated data types with an example.

5 marks

Answer

Sign in to view the complete answer paper.

b

Consider the array declaration: float a[5]; and the memory address of a[0] is 4056. What is the memory address of a[2]?

5 marks

Answer

Sign in to view the complete answer paper.

OR
510 marks
a

What is a structure? Explain how to declare, initialize and access the structure elements.

5 marks

Answer

Sign in to view the complete answer paper.

b

Write a program to find the string length by using string function.

5 marks

Answer

Sign in to view the complete answer paper.

610 marks
a

What is a file pointer? Explain the steps for sequential file operations.

5 marks

Answer

Sign in to view the complete answer paper.

b

Compare gets() and fgets() with an example.

5 marks

Answer

Sign in to view the complete answer paper.

OR
710 marks
a

Write a program to copy the contents of one file to another file.

5 marks

Answer

Sign in to view the complete answer paper.

b

List and define the preprocessor statements in C.

5 marks

Answer

Sign in to view the complete answer paper.

810 marks
a

What is a function prototype? Give an example.

5 marks

Answer

Sign in to view the complete answer paper.

b

Explain about different parameter passing mechanisms with examples.

5 marks

Answer

Sign in to view the complete answer paper.

OR
910 marks
a

Define Recursion. Write a recursive function for swapping of two numbers .

5 marks

Answer

Sign in to view the complete answer paper.

b

Write a program for printing Fibonacci series by using Recursive function.

5 marks

Answer

Sign in to view the complete answer paper.

1010 marks
a

Apply linear search on {22,11,66,44,99,55,88}.

5 marks

Answer

Sign in to view the complete answer paper.

b

Apply bubble sort on the above given data.

5 marks

Answer

Sign in to view the complete answer paper.

OR
1110 marks
a

What do you mean by sorting? Mention the different types of sorting.

5 marks

Answer

Sign in to view the complete answer paper.

b

Explain quick sort in detail on {24,12,11,76,39,12,67,34,88,91,26,45,78}.

5 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 CE I Year I-I, December – 2018, 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...