JNTU
JNTU MCA 2023 COMPUTER PROGRAMMING USING C Previous Question Paper (March - 2023 - R17)
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
Explain list wise operators.
Answer
In C, there is no specific operator called a 'list-wise' operator. This term is often a misnomer for the comma operator (,), which allows multiple expressions to be evaluated in a single statement. The expressions are evaluated from left to right, and the value of the entire expression is the value of the rightmost operand.
For example, in x = (y=5, y+10);, y is assigned 5, and then x is assigned 15.
Write a C program to check whether a number is positive or negative.
Answer
#include <stdio.h>
int main() {
int n;
printf("Enter a number: ");
scanf("%d", &n);
if (n >= 0) printf("Positive");
else printf("Negative");
return 0;
}What is a Pointer? Mention the advantages of pointers. How do you declare a pointer variable? Explain.
Answer
Sign in to view the complete answer paper.
Define a structure and state how the members of a structure are accessed with example.
Answer
Sign in to view the complete answer paper.
What is difference between file opening mode r+ and w+?
Answer
Sign in to view the complete answer paper.
Part B
What is an operator? List and explain various types of operators in C.
Answer
Sign in to view the complete answer paper.
Write a C program that prints the size of int, float, double and char variables.
Answer
Sign in to view the complete answer paper.
What is type conversion? Explain two types of conversion with examples.
Answer
Sign in to view the complete answer paper.
Write a C program to find the area and perimeter of a circle.
Answer
Sign in to view the complete answer paper.
Write the usage of break and continue statement with example.
Answer
Sign in to view the complete answer paper.
Write a program to calculate factorial of a number using function.
Answer
Sign in to view the complete answer paper.
Compare and contrast while and do while loop.
Answer
Sign in to view the complete answer paper.
Write a C program to print the odd numbers from X to Y using do while loop.
Answer
Sign in to view the complete answer paper.
Explain pointers to functions.
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.
With proper examples explain different arithmetic operations on pointers.
Answer
Sign in to view the complete answer paper.
Write a C program to store numbers into an array and find the frequency of a particular number in array and print it.
Answer
Sign in to view the complete answer paper.
Explain an array of structures with examples.
Answer
Sign in to view the complete answer paper.
Write a C program for passing structures as function arguments and returning a structure from a function.
Answer
Sign in to view the complete answer paper.
Explain different approaches that can be used to pass structures as function arguments. Illustrate each of them with suitable example.
Answer
Sign in to view the complete answer paper.
What are bit-fields? Explain their significance.
Answer
Sign in to view the complete answer paper.
Write a program to read data from keyboard, write it to a file called “INPUT”, again read the same data from the “INPUT” file and display item on the screen.
Answer
Sign in to view the complete answer paper.
Create a structure named employee containing name, age and salary. Write a C program to read employee records and write to a file. Then read the records from file and display them.
Answer
Sign in to view the complete answer paper.