JNTU
JNTU B.Tech I COMPUTER PROGRAMMING IN C Previous Question Paper (July/ August - 2021 - R16)
Answer any five questions
All questions carry equal marks
Main
What are the steps in program development?
Answer
The program development life cycle consists of several systematic steps to ensure the creation of reliable and efficient software:
- Problem Definition: Clearly defining the problem to be solved and identifying the requirements and constraints.
- Algorithm/Flowchart Design: Developing a logical step-by-step procedure or a visual representation of the program flow.
- Coding: Translating the algorithm into a high-level programming language such as C.
- Compilation and Linking: Converting the source code into machine-readable object code and linking necessary libraries.
- Testing and Debugging: Executing the program with various test cases to identify and fix syntax, logical, or runtime errors.
- Documentation: Creating manuals and internal code comments to explain the program's functionality for future maintenance.
- Maintenance: Updating and improving the program over time to meet changing requirements or fix newly discovered issues.
Write an algorithm to check whether a given number is prime or not.
Answer
To determine if a number n is prime, follow these steps:
- Start.
- Read the input number n.
- If n ≤ 1, display "Not Prime" and go to step 9.
- Initialize a variable i = 2.
- Set a flag isPrime = true.
- While i ≤ (n / 2):
a. If n % i == 0, set isPrime = false and break the loop.
b. Increment i by 1. - If isPrime is true, display "Prime Number".
- Else, display "Not a Prime Number".
- Stop.
What are the various data types? Give its size and the need for type casting.
Answer
Sign in to view the complete answer paper.
What are the four storage classes? Discuss their scope rules.
Answer
Sign in to view the complete answer paper.
How upward communication is possible among functions?
Answer
Sign in to view the complete answer paper.
Draw a flowchart for bubble sort.
Answer
Sign in to view the complete answer paper.
How to pass an array, an element of an array as a parameter to a function?
Answer
Sign in to view the complete answer paper.
What is meant by dynamic memory management? How C language supports programmers in memory management? Explain with relevant code segments.
Answer
Sign in to view the complete answer paper.
Write a C program for converting an array of alphabet from lowercase to uppercase.
Answer
Sign in to view the complete answer paper.
Write a C program to illustrate the use of indirection operator to access the value pointed by a pointer.
Answer
Sign in to view the complete answer paper.
Is union preferred over structures by good programmers? Justify your answer.
Answer
Sign in to view the complete answer paper.
What is the need of enumerated data types?
Answer
Sign in to view the complete answer paper.
Differentiate between text files and binary files.
Answer
Sign in to view the complete answer paper.
Demonstrate the use of fread() and fclose() functions.
Answer
Sign in to view the complete answer paper.