Sei sulla pagina 1di 6

JECRC University, Jaipur

School of Engineering
III in Semester Examinations November 2016
MCA Semester V
Professionals Skill II
Paper code: MCA-044A
Time:1:30 hrs Maximum marks: 50
Instructions:
1. Answer all questions.
2. Write legibly on both sides of the answer book.
3. Write relevant question numbers before writing the answer.

Objective type questions: 1x50= 50 marks


JECRC University, Jaipur
School of Engineering
III in Semester Examinations November 2016
MCA Semester V
Professionals Skill II
Paper code: MCA-044A
Time:1:30 hrs Maximum marks: 50
Instructions:
1. Answer all questions.
2. Write legibly on both sides of the answer book.
3. Write relevant question numbers before writing the answer.
Objective type questions: 1x50= 50 marks

Q1. In C, if you pass an array as an argument to a function, what actually gets passed?
A. Value of elements in array
B. First element of the array
C. Base address of the array
D. Address of the last element of array

Q2.The keyword used to transfer control from a function back to the calling function is
A. switch B. goto
C. go back D. return

Q3.How many times the program will print " JECRCU " ?
#include<stdio.h>
int main()
{
printf("JECRCU");
main();
return 0;
}

A. Infinite times B. 32767 times


C. 65535 times D. Till stack overflows

Q4.How will you free the memory allocated by the following program?
#include<stdio.h>
#include<stdlib.h>
#define MAXROW 3
#define MAXCOL 4
int main()
{
int **p, i, j;
p = (int **) malloc(MAXROW * sizeof(int*));
return 0;
}

A. memfree(int p); B. dealloc(p);


C. malloc(p, 0); D. free(p);

Q 5. Minimum number of moves required to solve a Tower of Hanoi puzzle is


A - 2n2 B - 2n-1
n
C-2 1 D - 2n - 1

Q6. .. Is a pile in which items are added at one end and removed from the other.
A) Stack B) Queue
C) List D) None of the above

Q7. When new data are to be inserted into a data structure, but there is not available space; this situation is
usually called....
A. Underflow B. overflow
C. houseful D. saturated

Q8. Selection sort first finds the .......... element in the list and put it in the first position.
A. Middle element B. Largest element
C. Last element D. Smallest element

Q9. Which of the following sorting algorithm is of divide and conquer type?
A. Bubble sort B. Insertion sort
C. Merge sort D. Selection sort
Q10. What is the output of this C code?
#include <stdio.h>
int main()
{
printf("before continue ");
continue;
printf("after continue\n");
}
a) Before continue after continue
b) Before continue
c) After continue
d) Compile time error

Q11. main() {
Int a=3, b=2, c*d*e;
d=&a; e=&b;
c=*d+*e;
}
Which one of the given answers is correct?
A) a=4, c-6 B) a=3, c=5
C) a=3, c=6 D) a=3, c=8

Q12. Which of the following option is correct?


#include <stdio.h>
int main()
{
int a = 1, b = 2, c = 3;
int *ptr1 = &a, *ptr2 = &b, *ptr3 = &c;
int **sptr = &ptr1;
*sptr = ptr2;
}
a) ptr1 points to a b) ptr1 points to b
c) sptr points to ptr2 d) None of the mentioned

Q13. What is the output of this C code?


#include <stdio.h>
void main()
{
int a[3] = {1, 2, 3};
int *p = a;
printf("%p\t%p", p, a);
}
a) Same address is printed.
b) Different address is printed.
c) Compile time error
d) Nothing

Q14. What is the output of this C code?


#include <stdio.h>
int main()
{
const int ary[4] = {1, 2, 3, 4};
int *p;
p = ary + 3;
*p = 5;
printf("%d\n", ary[3]);

}
a) 4 b) 5
c) Compile time error d) 3
Q 15. In binary heap, whenever the root is removed then the rightmost element of last level is replaced by the
root. Why?
A - It is the easiest possible way.
B - To make sure that it is still complete binary tree.
C - Because left and right sub tree might be missing.
D - None of the above!

Q 16. Which of the following algorithm does not divide the list
A - linear search B - binary search
C - merge sort D - quick sort

Q 17. For a binary search algorithm to work, it is necessary that the array (list) must be
A sorted B - unsorted
C - in a heap D - popped out of stack

Q 18. Visiting root node after visiting left and right sub-trees is called
A - In-order Traversal B - Pre-order Traversal
C - Post-order Traversal D- None of the above

Q19.Time required to merge two sorted lists of size m and n, is


A - (m | n) B - (m + n)
C - (m log n) D - (n log m)

Q20. In a min heap


A - minimum values are stored.
B - child nodes have less value than parent nodes.
C - parent nodes have less value than child nodes.
D - maximum value is contained by the root node.

Q 21. A queue data-structure can be used for


A - expression parsing
B - recursion
C - resource allocation
D - all of the above

Q 22Heap is an example of
A - complete binary tree
B - spanning tree
C - sparse tree
D - binary search tree

Q 23. Queue data structure works on


A LIFO B - FIFO
C FILO D - none of the above

Q24.Which of the following is not logical operator?


A & B. &&
C. || D. !

Q25. Which of the following cannot be checked in a switch-case statement?


A. Character B.Integer
C. Float D. enum
return 0; A. Bubble sort c) sptr points to ptr2
} B. Insertion d) None of the
Q1. In C, if you pass sort mentioned
an array as an A. memfree(int p); C. Merge sort
argument to a B. D. Selection Q13. What is the
function, what dealloc(p); sort output of this C
actually gets passed? C. malloc(p, 0); Q10. What is the code?
A. Value of elements D. free(p); output of this C #include
in array code? <stdio.h>
B. First element of Q 5. Minimum #include void main()
the array number of moves <stdio.h> {
C. Base address of required to solve a int main() int a[3] = {1,
the array Tower of Hanoi { 2, 3};
D. Address of the puzzle is printf("before int *p = a;
last element of array A - 2n2 continue "); printf("%p\t
B - 2n-1 continue; %p", p, a);
n
Q2.The keyword C-2 1 printf("after }
used to transfer D - 2n - 1 continue\n"); a) Same address is
control from a } printed.
function back to the Q6. .. Is a) Before continue b) Different address
calling function is a pile in which items after continue is printed.
A. switch B. are added at one end b) Before continue c) Compile time
goto and removed from c) After continue error
C. go back D. the other. d) Compile time d) Nothing
return A) Stack error
B) Queue Q14. What is the
Q3.How many times C) List Q11. main() { output of this C
the program will D) None of Int a=3, code?
print " JECRCU " ? the above b=2, c*d*e; #include
#include<stdio.h> d=&a; <stdio.h>
int main() Q7. When new data e=&b; int main()
{ are to be inserted c=*d+*e; {
into a data structure, } const int
printf("JECRCU"); but there is not Which one ary[4] = {1, 2, 3, 4};
main(); available space; this of the given answers int *p;
return 0; situation is usually is correct? p = ary + 3;
} called.... A) a=4, c-6 B) *p = 5;
A. Underflow a=3, c=5
A. Infinite times B. overflow C) a=3, c=6 D) printf("%d\n",
B. 32767 C. houseful a=3, c=8 ary[3]);
times D. saturated
C. 65535 times Q12. Which of the }
D. Till stack Q8. Selection sort following option is a) 4
overflows first finds the .......... correct? b) 5
element in the list #include c) Compile time
Q4.How will you and put it in the first <stdio.h> error d) 3
free the memory position. int main()
allocated by the A. Middle element { Q 15. In binary heap,
following program? B. Largest int a = 1, b = whenever the root is
#include<stdio.h> element 2, c = 3; removed then the
#include<stdlib.h> C. Last element int *ptr1 = rightmost element of
#define MAXROW D. Smallest &a, *ptr2 = &b, last level is replaced
3 element *ptr3 = &c; by the root. Why?
#define MAXCOL 4 int **sptr = A - It is the easiest
int main() Q9. Which of the &ptr1; possible way.
{ following sorting *sptr = ptr2; B - To make sure that
int **p, i, j; algorithm is of } it is still complete
p = (int **) divide and conquer a) ptr1 points to a binary tree.
malloc(MAXROW * type? b) ptr1 points to b
sizeof(int*));
C - Because left and D - maximum value
right sub tree might is contained by the
be missing. root node.
D - None of the
above! Q 21. A queue data-
structure can be used
Q 16. Which of the for
following algorithm A - expression
does not divide the parsing
list B - recursion
A - linear search C - resource
B - binary allocation
search D - all of the above
C - merge sort
D - quick Q 22Heap is an
sort example of
A - complete binary
Q 17. For a binary tree
search algorithm to B - spanning tree
work, it is necessary C - sparse tree
that the array (list) D - binary search
must be tree
A sorted
B - unsorted Q 23. Queue data
C - in a heap structure works on
D - popped A LIFO B-
out of stack FIFO
C FILO D-
Q 18. Visiting root none of the above
node after visiting
left and right sub- Q24.Which of the
trees is called following is not
A - In-order logical operator?
Traversal B- A & B.
Pre-order Traversal &&
C - Post-order C. ||
Traversal D- D. !
None of the above
Q25. Which of the
Q19.Time required following cannot be
to merge two sorted checked in a switch-
lists of size m and n, case statement?
is A. Character
A - (m | n) B.Integer
B - (m + C. Float D.
n) enum
C - (m log n)
D - (n log
m)

Q20. In a min heap


A - minimum values
are stored.
B - child nodes have
less value than
parent nodes.
C - parent nodes
have less value than
child nodes.

Potrebbero piacerti anche