This document outlines the examination details for the C and Data Structure course for MCA students, including the structure of the exam, types of questions, and specific topics to be covered. It includes sections for compulsory questions, short answer questions, and long answer questions, addressing various programming concepts and C language functionalities. The document also specifies the maximum marks and time allotted for the exam.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0 ratings0% found this document useful (0 votes)
14 views3 pages
Data Structure
This document outlines the examination details for the C and Data Structure course for MCA students, including the structure of the exam, types of questions, and specific topics to be covered. It includes sections for compulsory questions, short answer questions, and long answer questions, addressing various programming concepts and C language functionalities. The document also specifies the maximum marks and time allotted for the exam.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 3
Registration No.:
fi
Total Number of Pages: 03 Course: MCA
Sub_Code: MCA01003
1° Semester Regular/Back Examination: 2023-24
SUBJECT: C and Data Structure
BRANCH(S): MCA (2 Yrs)
Time: 3 Hour
Max Marks: 100
i Q.Code: N550
Answer Question No.1 (Part-1) which is compulsory, any eight from Partsll and any two
from Partulll.
The figures in the right hand margin indicate marks.
Part
at Answer the following questions: (2x 10)
a) Briefly write about conditional operator with a suitable example.
b) What will be the output of the following C program?
#include
int main() {
int *ptr;
*ptr = 5;
printf("%d", *ptr);
return 0; }
¢) Write any three library functions to read from a file. If fopen() functions is not able to
open a file, what does it returns?
d) What value stremp() function returns when two strings are: 1) same, 2) different?
e) Predict the output of below program:
#include
int main()
{ intarr[5];_ 1 Assume base address of arr is 2000 and size of integer is 32 bit
printf("2ou%u", arr+1, &arr+1);
return 0; }
f) Write the C code to allocate space dynamically to a two-dimensional array of size 20 x
30
9) Differentiate between linear and nonlinear data structure,
h) Suppose a circular queue of capacity n elements is implemented with an array of n
elements. Assume that the insertion and deletion operation are carried out using
REAR and FRONT as array index variables, respectively. Initially, REAR = FRONT = -
1. Write the conditions to detect queue full and queue empty.
i) Consider n elements that are equally distributed in k stacks. In each stack, elements
of it are arranged in ascending order (min is at the top in each of the stack and then
increasing downwards). Given a queue of size n in which we have to put all n
elements in increasing order. What will be the time complexity of the tee
algorithm? iThe two stacks grow
i) Assingle array A [1..MAXSIZE] is used to implement two ea < top2) point ‘a the
from opposite ends of the array. Variables top? and top if the space is 10 Seyi
location of the topmost element in each of the stacks iq
efficiently, write the condition for “stack full”.
Part-ll i
Questions- (Answer Any Eight out of Twelve)
e data types supported by C language with
dd numbers separately
Q2 ‘Only Focused-Short Answer Type
a) Define data type. Explain primitive
examples. Write a C program to print even numbers and 0%
between 100 to 200. ‘ | 4
b) Write the syntax of different branching statements and explain their working wi
examples. Write a C program to print the reverse of a given integer. ah
c) Bae Races Bautsontroled loop and exit controlled loop. Explain with
syntax and example. Write a C program to multiply two matrices. j
d) Define recursive function. Write a C program to print the Nth Fibonacci number using.
recursion.
Fibonacci numbers are: FO = 0, F1=1,F2=1,F3=2,F4=3,F5=Sandsoon
e) Explain with suitable examples the scope, visibility, and lifetime of auto, external,
static and register variables. ‘
g) Define a pointer. Discuss the declaration and initialization of the pointer variable.
Define a function that uses pointers to take two matrices as input and returns thei
product.
h) An electricity board charges the following rates for the use of electri
200 units 80 paise per unit: for the next 100 units 90 paise per unit: beyond 300 unit
Rs. 1 per unit. All users are charged a minimum of Rs. 100 as meter charge. If the
total amount is more than Rs. 400, then an additional surcharge of 15% of the total
amount is charged, Write a C program to read the name of the user, number of uni
consumed and print out the charges.
Differentiate properly the various modes of opening a file in C programming,
Write a C program to create a file to store sequentially a list of products with the di
-ID, Name, Rate, and Quantity. :
Jj) How many queues are needed to implement a stack? Consider the situation where
other data structure like arrays, linked list is available to you. Justify your answer,
1) Evaluate the following postfix expression with single digit operands using a stack:
8234/23"4+51*— ) ;
‘Show the detailed steps to convert given infix to posttix:
Ir p+q*r+(s*t+u)*vQ6
Part-Iil
Only Long Answer Type Questions (Answer Any Two out of Four)
What is. an array? Discuss different ways to declare and define one-dimensional and
two-dimensional arrays with suitable examples.
Write a C program to enter a matrix of order m X n then print the difference between
eae the elements of main diagonal and sum of the elements of first row of the
matrix.
i '
Define function. Explain the different types of functions based on parameters. Write
the definition of following functions without using library functions.
a. Compute the length of a string.
b. Concatenate two strings.
c. Convert a number from string format to integer format
Differentiate between structure and union, with an appropriate example that
demonstrates the storage of the data members.
You are required to rank the students of a classroom based on their marks in a
particular subject. Define a student structure containing the members — ID, Name,
Marks, and Rank. Provide user input facility for 10 students’ data (ID, Name, Marks).
Give the rank values as per the student ranking in the class. Define functions to print
the data as a table.
Compare stack and queue data structure?
Convert the following infix expression to its equivalent postfix expression:
(A+ B)/((D=E)*F)
Evaluate the following Postfix expression:
12, 7, 3, = fii se
(16)
(16)
(16)
(16)