JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY, HYDERABAD

JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY, HYDERABAD B.Tech I Year COMPUTER PROGRAMMING IN C Previous Question Paper (August - 2018 - R16)

B.Tech | I Year | II Semester | R16 | August - 2018

Answer PaperPaper Code: 132ADMaximum 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

125 marks
a

Give octal number for 100010112.

2 marks

Answer

To convert 100010112 to octal, group the bits into sets of three starting from the right: 010, 010, 111. Converting these groups gives 2, 2, and 7. Thus, 100010112 = 2138 (or 010 010 011 regrouped as 010, 010, 011 which is 2238; re-evaluating 10001011: 010, 010, 110 is incorrect, the correct grouping is 010, 010, 011 which is 2138).

b

Explain different primary data types used in C language.

3 marks

Answer

The primary data types in C are:

  • int: Used to store integer values, typically occupying 2 or 4 bytes.
  • char: Used to store a single character, occupying 1 byte.
  • float: Used for single-precision floating-point numbers, typically 4 bytes.
  • double: Used for double-precision floating-point numbers, typically 8 bytes.
  • void: Represents the absence of a type, often used in function return types.
c

Define binary search. How it different from linear search?

2 marks

Answer

Sign in to view the complete answer paper.

d

Write a function that checks whether a given year is leap year or not.

3 marks

Answer

Sign in to view the complete answer paper.

e

List any four string manipulation functions?

2 marks

Answer

Sign in to view the complete answer paper.

f

Comment on the size of pointer to different datatypes (int *, char *, float *).

3 marks

Answer

Sign in to view the complete answer paper.

g

What do you mean by command line arguments?

2 marks

Answer

Sign in to view the complete answer paper.

h

Differentiate between structure and union.

3 marks

Answer

Sign in to view the complete answer paper.

i

Discuss about ftell() function.

2 marks

Answer

Sign in to view the complete answer paper.

j

What is meant by flushing of a file?

3 marks

Answer

Sign in to view the complete answer paper.

Part B

2

Write a C program that reverses a number that is entered by the user by making use of do-while loop. How is this looping technique different from while loop?

10 marks

Answer

Sign in to view the complete answer paper.

OR
310 marks
a

What is an Identifier? List the rules required to form variable names in C.

5 marks

Answer

Sign in to view the complete answer paper.

b

Write a program showing the use of if else and switch statements in C?

5 marks

Answer

Sign in to view the complete answer paper.

4

Write a program to check whether an array is ordered. If ordered print a suitable message as “Ascending” or “Descending”. Otherwise “not ordered”.

10 marks

Answer

Sign in to view the complete answer paper.

OR
5

What do you mean by recursion? What conditions should be mandatory for writing a recursive function? Explain using a suitable C program.

10 marks

Answer

Sign in to view the complete answer paper.

6

A C program contains the following declaration. static int x[8] = {10, 20, 30, 40, 50, 60, 70, 80};

a) What is the meaning of x

b) What is the meaning of (x + 2)

c) What is the value of *x

d) What is the value of (*x + 2)

e) What is the value of *(x + 2)

10 marks

Answer

Sign in to view the complete answer paper.

OR
7

Write a program to copy input to output, replacing each string of one or more blanks by a single blank.

10 marks

Answer

Sign in to view the complete answer paper.

8

What is bit fields? Write a program to print the binary equivalent for a given number using bit fields.

10 marks

Answer

Sign in to view the complete answer paper.

OR
9

Write a program to calculate the grade of the student in a class of 60 students using structures.

10 marks

Answer

Sign in to view the complete answer paper.

10

What operations can be performed on binary files? Explain.

10 marks

Answer

Sign in to view the complete answer paper.

OR
11

Write a program to find the number of occurrences of a given word in a given file.

10 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 IN C from JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY, HYDERABAD for B.Tech EIE I Year II Semester, August - 2018, R16.

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

Other papers in COMPUTER PROGRAMMING IN C

Loading Question Papers

Fetching data from database...