JNTU
JNTU B.Tech I PROGRAMMING FOR PROBLEM SOLVING Previous Question Paper (March/April - 2023 - R18)
Note: i) Question paper consists of Part A, Part B. ii) Part A is compulsory, which carries 25 marks. In Part A, Answer all questions. iii) In Part B, Answer any one question from each unit. Each question carries 10 marks and may have a, b as sub questions.
Part A
Define a Flow chart.
Answer
A flowchart is a graphical or diagrammatic representation of an algorithm or a step-by-step process used to solve a specific problem. It illustrates the sequence of operations, decisions, and data flow within a program using standardized geometric symbols connected by directional arrows.
Key characteristics include:
- Standardized Symbols: Utilizes specific shapes such as ovals for start/end points, parallelograms for input/output, rectangles for processing steps, and diamonds for decision-making.
- Visual Clarity: Provides a clear, high-level overview of the logic flow, making it easier to identify potential errors or bottlenecks before writing the actual source code.
- Communication Tool: Serves as an effective medium for documenting program logic, allowing developers to communicate complex algorithms to others in a language-independent manner.
How to declare a variable?
Answer
In C programming, declaring a variable involves specifying its data type followed by its identifier (name) and terminating the statement with a semicolon. This process informs the compiler about the amount of memory to allocate and the type of data the variable will store.
The general syntax is:
data_type variable_name;Key points regarding variable declaration:
- Data Type: Defines the nature of the data (e.g., int for integers, float for floating-point numbers, char for characters).
- Identifier: The name assigned to the memory location. It must follow C naming conventions (must start with a letter or underscore, cannot be a keyword).
- Multiple Declaration: Variables of the same type can be declared in a single line by separating them with commas, such as
int x, y, z;. - Initialization: A variable can be assigned an initial value during declaration, known as initialization, for example:
int age = 20;.
How the pointer variable declared?
Answer
Sign in to view the complete answer paper.
What do you mean by array of pointers?
Answer
Sign in to view the complete answer paper.
Difference between undef and ifndef.
Answer
Sign in to view the complete answer paper.
Write the use of rewind function.
Answer
Sign in to view the complete answer paper.
Define formal arguments.
Answer
Sign in to view the complete answer paper.
Write the syntax of malloc () function.
Answer
Sign in to view the complete answer paper.
What do you mean by time complexity?
Answer
Sign in to view the complete answer paper.
Define the best-case performance of an algorithm.
Answer
Sign in to view the complete answer paper.
Part B
Write a detailed note on creating and running the program.
Answer
Sign in to view the complete answer paper.
Devise an algorithm sum of n numbers using while and for loop.
Answer
Sign in to view the complete answer paper.
Discuss about decision making statements with example.
Answer
Sign in to view the complete answer paper.
What is an Algorithm? Write an algorithm to find the largest of 3 numbers.
Answer
Sign in to view the complete answer paper.
Explain the following functions with an example. i) strcat ii) strcpy
Answer
Sign in to view the complete answer paper.
Write a C program to insert a sub-string in to a given main string from a given position.
Answer
Sign in to view the complete answer paper.
Explain array of structure with an example.
Answer
Sign in to view the complete answer paper.
Write a program to find the multiplication of two matrices(size of matrix 2×2).
Answer
Sign in to view the complete answer paper.
List the various differences between binary file and text file.
Answer
Sign in to view the complete answer paper.
Write a C program which copies one file to another, replacing all lowercase characters with their uppercase equivalents.
Answer
Sign in to view the complete answer paper.
Explain in detail file handling functions with example each.
Answer
Sign in to view the complete answer paper.
Discuss the type of functions based on parameters and return type.
Answer
Sign in to view the complete answer paper.
Write a program in C using functions to swap two numbers using global variables concept and call by reference concept.
Answer
Sign in to view the complete answer paper.
Explain the various differences between user defined and library functions.
Answer
Sign in to view the complete answer paper.
What is recursion? What are the advantages and disadvantages of recursion?
Answer
Sign in to view the complete answer paper.
Explain the technique Insertion sort with the help of an example array.
Answer
Sign in to view the complete answer paper.
Describe the linear search algorithm with an example. Find the time complexity of it in all cases.
Answer
Sign in to view the complete answer paper.
Discuss binary search algorithm with an example.
Answer
Sign in to view the complete answer paper.
Write an algorithm to find the sum of all elements in an array and find the time complexity of it.
Answer
Sign in to view the complete answer paper.