JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD

JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD B.Tech I Year COMPUTER PROGRAMMING Previous Question Paper (October/November - 2020 - R15)

B.Tech | I Year | I-I | R15 | October/November - 2020

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

Answer any five questions. All questions carry equal marks.

Main

1

Explain the concept of precedence and associativity. Mention its role in eliminating the ambiguity while evaluating an expression.

15 marks

Answer

Operator precedence determines the order in which different operators are evaluated in an expression. When an expression contains multiple operators with different levels of precedence, the operator with the higher precedence is evaluated first. For example, in the expression 5 + 3 * 2, the multiplication operator (*) has higher precedence than the addition operator (+), so it is performed first, resulting in 11 rather than 16.

Operator associativity defines the order of evaluation for operators that have the same level of precedence. This can be either left-to-right or right-to-left. For instance, the subtraction operator (-) is left-associative, meaning 10 - 5 - 2 is evaluated as (10 - 5) - 2, resulting in 3. Conversely, the assignment operator (=) is right-associative, allowing for chained assignments like a = b = 5, where 5 is assigned to b, and then the result is assigned to a.

These rules are fundamental in eliminating ambiguity during expression evaluation by providing a strict, deterministic hierarchy for the compiler. Without these rules, a single expression could yield multiple valid results depending on the order of operations, making code execution unpredictable. By enforcing a standard order, precedence and associativity ensure that every expression is parsed and computed consistently across different compilers and platforms, allowing programmers to write complex mathematical and logical statements without requiring excessive parentheses to define the intended order of operations.

215 marks
a

Define an array and write syntax and example for multi dimensional arrays.

7 marks

Answer

An array is a collection of a fixed number of elements of the same data type stored in contiguous memory locations. Each element is accessed using an index, starting from zero.

A multi-dimensional array is an array of arrays. The syntax for declaring a two-dimensional array is:

data_type array_name[rows][columns];

Example of a 2x3 integer array:

int matrix[2][3] = {{1, 2, 3}, {4, 5, 6}};
b

Give an example C program to show how an array can be passed to a function.

8 marks

Answer

Sign in to view the complete answer paper.

3

Write a C program that reads a sentence and prints frequency of each of the letter in a given sentence.

15 marks

Answer

Sign in to view the complete answer paper.

415 marks
a

Differentiate between text and binary files.

7 marks

Answer

Sign in to view the complete answer paper.

b

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

8 marks

Answer

Sign in to view the complete answer paper.

5

What is a linked list? Explain the insertion of new node into a single linked list at various possible locations.

15 marks

Answer

Sign in to view the complete answer paper.

6

Write a C Program to print equivalent binary number of given decimal number.

15 marks

Answer

Sign in to view the complete answer paper.

7

Given a randomly ordered array of n elements determine the kth smallest element in the set.

15 marks

Answer

Sign in to view the complete answer paper.

8

Explain the concept of pointers. Also explain operations on pointers and array of pointers.

15 marks

Answer

Sign in to view the complete answer paper.

About this paper

This page contains the question paper of COMPUTER PROGRAMMING from JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD for B.Tech IT I Year I-I, October/November - 2020, R15.

For the solved question paper with answers, switch to the Answer Paper tab.

Other papers in COMPUTER PROGRAMMING

Loading Question Papers

Fetching data from database...