JNTU
JNTU B.Tech I Year PROGRAMMING FOR PROBLEM SOLVING Previous Question Paper (December – 2018 - R18)
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
What is a flowchart? Explain with one example.
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.
Discuss about Strlen() function with an example.
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;
}Explain fseek() function with example.
Answer
Sign in to view the complete answer paper.
Explain about the parameter passing using copy by address.
Answer
Sign in to view the complete answer paper.
Write an algorithm to find the given number is prime or not.
Answer
Sign in to view the complete answer paper.
C is a structured programming language? Justify.
Answer
Sign in to view the complete answer paper.
How pointer can be used for accessing multi dimensional arrays? Discuss.
Answer
Sign in to view the complete answer paper.
Name few preprocessor directives.
Answer
Sign in to view the complete answer paper.
Write Recursive function for towers of honoi.
Answer
Sign in to view the complete answer paper.
Find out no. of comparisons to sort {2,1,7,4,8,6}.
Answer
Sign in to view the complete answer paper.
Part B
Describe the various control structures available in ‘C’.
Answer
Sign in to view the complete answer paper.
Write a program to find whether the given no is am strong or not.
Answer
Sign in to view the complete answer paper.
Explain about different bit-wise operators with examples.
Answer
Sign in to view the complete answer paper.
What are command line arguments? Explain with a complete ‘C’ program.
Answer
Sign in to view the complete answer paper.
Explain about Enumerated data types with an example.
Answer
Sign in to view the complete answer paper.
Consider the array declaration: float a[5]; and the memory address of a[0] is 4056. What is the memory address of a[2]?
Answer
Sign in to view the complete answer paper.
What is a structure? Explain how to declare, initialize and access the structure elements.
Answer
Sign in to view the complete answer paper.
Write a program to find the string length by using string function.
Answer
Sign in to view the complete answer paper.
What is a file pointer? Explain the steps for sequential file operations.
Answer
Sign in to view the complete answer paper.
Compare gets() and fgets() with an example.
Answer
Sign in to view the complete answer paper.
Write a program to copy the contents of one file to another file.
Answer
Sign in to view the complete answer paper.
List and define the preprocessor statements in C.
Answer
Sign in to view the complete answer paper.
What is a function prototype? Give an example.
Answer
Sign in to view the complete answer paper.
Explain about different parameter passing mechanisms with examples.
Answer
Sign in to view the complete answer paper.
Define Recursion. Write a recursive function for swapping of two numbers .
Answer
Sign in to view the complete answer paper.
Write a program for printing Fibonacci series by using Recursive function.
Answer
Sign in to view the complete answer paper.
Apply linear search on {22,11,66,44,99,55,88}.
Answer
Sign in to view the complete answer paper.
Apply bubble sort on the above given data.
Answer
Sign in to view the complete answer paper.
What do you mean by sorting? Mention the different types of sorting.
Answer
Sign in to view the complete answer paper.
Explain quick sort in detail on {24,12,11,76,39,12,67,34,88,91,26,45,78}.
Answer
Sign in to view the complete answer paper.