JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY, HYDERABAD
JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY, HYDERABAD B.Tech I Year COMPUTER PROGRAMMING IN C Previous Question Paper (August - 2018 - R16)
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
Give octal number for 100010112.
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).
Explain different primary data types used in C language.
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.
Define binary search. How it different from linear search?
Answer
Sign in to view the complete answer paper.
Write a function that checks whether a given year is leap year or not.
Answer
Sign in to view the complete answer paper.
List any four string manipulation functions?
Answer
Sign in to view the complete answer paper.
Comment on the size of pointer to different datatypes (int *, char *, float *).
Answer
Sign in to view the complete answer paper.
What do you mean by command line arguments?
Answer
Sign in to view the complete answer paper.
Differentiate between structure and union.
Answer
Sign in to view the complete answer paper.
Discuss about ftell() function.
Answer
Sign in to view the complete answer paper.
What is meant by flushing of a file?
Answer
Sign in to view the complete answer paper.
Part B
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?
Answer
Sign in to view the complete answer paper.
What is an Identifier? List the rules required to form variable names in C.
Answer
Sign in to view the complete answer paper.
Write a program showing the use of if else and switch statements in C?
Answer
Sign in to view the complete answer paper.
Write a program to check whether an array is ordered. If ordered print a suitable message as “Ascending” or “Descending”. Otherwise “not ordered”.
Answer
Sign in to view the complete answer paper.
What do you mean by recursion? What conditions should be mandatory for writing a recursive function? Explain using a suitable C program.
Answer
Sign in to view the complete answer paper.
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)
Answer
Sign in to view the complete answer paper.
Write a program to copy input to output, replacing each string of one or more blanks by a single blank.
Answer
Sign in to view the complete answer paper.
What is bit fields? Write a program to print the binary equivalent for a given number using bit fields.
Answer
Sign in to view the complete answer paper.
Write a program to calculate the grade of the student in a class of 60 students using structures.
Answer
Sign in to view the complete answer paper.
What operations can be performed on binary files? Explain.
Answer
Sign in to view the complete answer paper.
Write a program to find the number of occurrences of a given word in a given file.
Answer
Sign in to view the complete answer paper.