JNTU
JNTU B.Tech I Year COMPUTER PROGRAMMING Previous Question Paper (September/October - 2021 - R13)
Answer any five questions. All questions carry equal marks.
Main
List and explain various computer languages in detail.
Answer
Computer languages are categorized based on their proximity to machine hardware and their abstraction level:
- Machine Language: The lowest-level language consisting entirely of binary digits (0s and 1s). It is directly executable by the CPU but is machine-dependent and extremely difficult for humans to write or debug.
- Assembly Language: A low-level language that uses mnemonic codes (like MOV, ADD, SUB) to represent machine instructions. It requires an assembler to translate code into machine language and provides direct control over hardware resources.
- High-Level Languages: Languages designed for human readability, using English-like syntax. They are machine-independent and require a compiler or interpreter to translate code into machine-executable form. Examples include C, C++, Java, and Python.
- Fourth-Generation Languages (4GL): Designed to reduce programming effort by focusing on 'what' to do rather than 'how' to do it. These are often used in database management and report generation, such as SQL.
Write a ‘C’ program to find whether the given number is prime or not.
Answer
The following C program determines if a given integer is a prime number by checking for divisors from 2 up to the square root of the number:
#include <stdio.h>
#include <math.h>
int main() {
int n, i, isPrime = 1;
printf("Enter a positive integer: ");
scanf("%d", &n);
if (n <= 1) isPrime = 0;
else {
for (i = 2; i <= sqrt(n); i++) {
if (n % i == 0) {
isPrime = 0;
break;
}
}
}
if (isPrime) printf("%d is a prime number.\n", n);
else printf("%d is not a prime number.\n", n);
return 0;
}What is recursion? Explain the limitations of recursion.
Answer
Sign in to view the complete answer paper.
Explain the representation and Indexing of Multi-dimensional array.
Answer
Sign in to view the complete answer paper.
What is pointer? Describe pointer for inter function communication.
Answer
Sign in to view the complete answer paper.
How to pass an array to function? Explain with example.
Answer
Sign in to view the complete answer paper.
What is a structure? Explain how it differs from arrays.
Answer
Sign in to view the complete answer paper.
Explain in detail about the file Input /Output functions.
Answer
Sign in to view the complete answer paper.
Explain Selection sort algorithm with an example.
Answer
Sign in to view the complete answer paper.
Explain the applications of queue.
Answer
Sign in to view the complete answer paper.
What is a Selection Statement? Explain various selection statements in ‘C’ Language with suitable examples.
Answer
Sign in to view the complete answer paper.
Write a ‘C’ program for Addition of two given matrices.
Answer
Sign in to view the complete answer paper.
List and explain various String Manipulation functions with example.
Answer
Sign in to view the complete answer paper.
Write a program to insert and delete an element from singly linked list.
Answer
Sign in to view the complete answer paper.
Differentiate between structure and union.
Answer
Sign in to view the complete answer paper.