JNTU

JNTU B.Tech I Year COMPUTER PROGRAMMING Previous Question Paper (September - 2023 - R15)

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

Answer PaperPaper Code: 121AFMaximum Marks: 75Time: 3 Hours

Part A is compulsory. In Part B, Answer any one question from each unit.

Part A

1a

Consider the following code:

int main() { int a = 5,b=6,c; c = (++a) + (b<<2); printf(“a = %d , b= %d , c= %d \n”, a, b, c); }

What is the output of above code? Justify your answer with two to three lines of explanation.

2 marks

Answer

The output of the code is: a = 6 , b = 6 , c = 30

Explanation: The pre-increment operator ++a increases the value of a from 5 to 6 before the addition. The left-shift operator b<<2 shifts the binary representation of 6 (0110) two positions to the left, resulting in 24 (11000). Finally, c is calculated as 6 + 24 = 30.

1b

Differentiate while loop and do-while loop.

3 marks

Answer

The primary differences between a while loop and a do-while loop are as follows:

  • Entry vs. Exit Controlled: A while loop is an entry-controlled loop, meaning the condition is evaluated before the loop body executes. A do-while loop is an exit-controlled loop, where the body executes at least once before the condition is checked.
  • Execution Guarantee: In a while loop, if the condition is false initially, the loop body never executes. In a do-while loop, the body is guaranteed to execute at least once regardless of the condition.
  • Syntax Structure: The while loop uses the structure while(condition) { ... }, whereas the do-while loop uses do { ... } while(condition);, which requires a semicolon after the condition.
1c

Develop a recursive function to find factorial of a given number.

2 marks

Answer

Sign in to view the complete answer paper.

1d

List different ways of initializing one dimensional array.

3 marks

Answer

Sign in to view the complete answer paper.

1e

How you define a pointer to an array. Give an example for it.

2 marks

Answer

Sign in to view the complete answer paper.

1f

How you declare a pointer to a function and how you call the function with the help that pointer variable? Give an example.

3 marks

Answer

Sign in to view the complete answer paper.

1g

Differentiate binary files with text files.

2 marks

Answer

Sign in to view the complete answer paper.

1h

Give an example of nested structure.

3 marks

Answer

Sign in to view the complete answer paper.

1i

Discuss the push operation of stack.

2 marks

Answer

Sign in to view the complete answer paper.

1j

List the applications of Queue data structure.

3 marks

Answer

Sign in to view the complete answer paper.

Part B

210 marks
a

Discuss about bitwise operators in C Language. Consider the expression X = 5+4*5 + a << 3, where a=4. Find the value of the variable X and also discuss about operator precedence and associativity in this context.

5 marks

Answer

Sign in to view the complete answer paper.

b

Malathi has 3 bags with weights A, B, and C. She wants to check-in exactly two and carry one. Check-in sum cannot exceed D and carried bag cannot exceed E. Find if Malathi can take all the three bags.

5 marks

Answer

Sign in to view the complete answer paper.

OR
310 marks
a

Discuss about different data types in C Language.

5 marks

Answer

Sign in to view the complete answer paper.

b

Develop C code to find whether Kattappa is ready for battle based on the count of lucky soldiers (even number of weapons) being strictly more than unlucky soldiers.

5 marks

Answer

Sign in to view the complete answer paper.

410 marks
a

Write a C program to read n values into an array and arrange them in increasing order.

5 marks

Answer

Sign in to view the complete answer paper.

b

Explain the types of arrays in C.

5 marks

Answer

Sign in to view the complete answer paper.

OR
510 marks
a

List the limitations of recursive functions.

5 marks

Answer

Sign in to view the complete answer paper.

b

Explain different parameter passing mechanisms in C language.

5 marks

Answer

Sign in to view the complete answer paper.

610 marks
a

Explain the concept of passing array to function with an example.

5 marks

Answer

Sign in to view the complete answer paper.

b

Write a C program to verify a substring str1 is present in another string str2 or not?

5 marks

Answer

Sign in to view the complete answer paper.

OR
710 marks
a

Write a C program to check a given string is palindrome or not.

5 marks

Answer

Sign in to view the complete answer paper.

b

Discuss about different dynamic memory allocation functions.

5 marks

Answer

Sign in to view the complete answer paper.

810 marks
a

Write a C program to define a structure called employee. Read n employees information (empid, empname, salary) and print it and find average salary.

5 marks

Answer

Sign in to view the complete answer paper.

b

Discuss about modes of opening a file.

5 marks

Answer

Sign in to view the complete answer paper.

OR
910 marks
a

Write a C code which reads two integers a, b (a

5 marks

Answer

Sign in to view the complete answer paper.

b

Write about self-referential structures.

5 marks

Answer

Sign in to view the complete answer paper.

1010 marks
a

Apply bubble sort on the following list: 4, 1, 7, 9, 11, 34, 21, 45, 22.

5 marks

Answer

Sign in to view the complete answer paper.

b

Write a C program to implement linear search.

5 marks

Answer

Sign in to view the complete answer paper.

OR
1110 marks
a

Give the concept of binary search with a suitable example.

5 marks

Answer

Sign in to view the complete answer paper.

b

Explain insert and delete operation in single linked list.

5 marks

Answer

Sign in to view the complete answer paper.

About this paper

This page contains the solved question paper with answers of COMPUTER PROGRAMMING from JNTU for B.Tech PTM I Year I-I, September - 2023, R15.

For the question paper without answers, switch to the Question Paper tab.

Other papers in COMPUTER PROGRAMMING

Loading Question Papers

Fetching data from database...