Explore topic-wise MCQs in CoCubes.

This section includes 45 Mcqs, each offering curated multiple-choice questions to sharpen your CoCubes knowledge and support exam preparation. Choose a topic below to get started.

1.

  Which keyword cannot be used while defining property?

A. Public
B. Static
C. Final
D. Private
Answer» D. Private
2.

Static properties cannot be initialized using

A. expressions
B. literal
C. constant
D. All of the above
Answer» B. literal
3.

In object oriented programming, by wrapping up characteristics and behavior into one unit, we achieve

A. Data Abstraction
B. Data Encapsulation
C. Data Hiding
D. All of these
Answer» C. Data Hiding
4.

What is a size of empty class in c++?

A. 4 bytes
B. 2 bytes
C. 0 bytes
D. 1 bytes
Answer» E.
5.

Which of the following operators can not be overloaded in C+ +?

A. *
B. ==
C. +=
D. ::
Answer» E.
6.

Which of the following concepts means adding new concepts to a program as it runs?

A. Data hiding
B. Dynamic loading
C. Dynamic typing
D. Dynamic binding
Answer» C. Dynamic typing
7.

Which of the following correctly describes overloading of functions?

A. Virtual polymorphism
B. Transient polymorphism
C. Ad-hoc polymorphism
D. Pseudo polymorphism
Answer» D. Pseudo polymorphism
8.

Which of the following function is used to find the first occurrence of a given string in another string?

A. STRCHR()
B. STRCHRR()
C. STRSTR()
D. STRNSET()
Answer» D. STRNSET()
9.

Identify which of the following are declarations 1 : extern int x; 2 : float square ( float x ) { ... } 3 : double pow(double, double);

A. 1
B. 2
C. 3
D. 1&3
Answer» E.
10.

Which of the following statements are correct about an array? 1: The array int num[26]; can store 26 elements. 2: The expression num[1] designates the very first element in the array. 3: It is necessary to initialize the array at the time of declaration. 4: The declaration num[SIZE] is allowed if SIZE is a macro.

A. 1
B. 1,4
C. 2,3
D. 2,4
Answer» C. 2,3
11.

What will be the output of the program ? #include void fun(int **p); int main() { int a[3][4] = {1, 2, 3, 4, 4, 3, 2, 8, 7, 8, 9, 0}; int *ptr; ptr = &a[0][0]; fun(&ptr); return 0; } void fun(int **p) { printf("%d\n", **p); }

A. 1
B. 2
C. 3
D. 4
Answer» B. 2
12.

What will be the output of the program? #include int main() { int i=-3, j=2, k=0, m; m = ++i || ++j && ++k; printf("%d, %d, %d, %d\n", i, j, k, m); return 0; }

A. 2,2,0,1
B. 1,2,1,0
C. 2,2,0,0
D. 2,2,0,1
Answer» E.
13.

What will be the output of the program?

A. BBBB
B. BBBBB
C. B
D. ERROR IS UNGETC STATEMENT
Answer» D. ERROR IS UNGETC STATEMENT
14.

Consider following given the code and predict its output. main() { int num[ ] = {1,4,8,12,16}; int *a,*b; int i; a=num; b=num+2; i=*a+1; printf("%d,%d,%d\n",i,*a,*b); }

A. 2,1,8
B. 4,1,8
C. 4,4,8
D. 2,4,8
Answer» B. 4,1,8
15.

Using bubble sort, the number of swapping needed to sort numbers 7,21,6,8,30,18,4,12 in ascending order is ?

A. 12
B. 16
C. 13
D. 14
Answer» E.
16.

For a binary search tree if the pre-order traversal is 1,2,3,5,8,9,6,10,4,7 and the in-order traversal is 2,1,8,5,9,3,10,6,7,4 then which of the following is the post-order traversal of the given tree?

A. 2,8,9,5,10,6,3,4,7,1
B. 2,8,9,5,10,6,3,7,4,1
C. 2,8,9,5,10,3,6,7,4,1
D. 2,8,9,5,1,10,6,3,7,4
Answer» C. 2,8,9,5,10,3,6,7,4,1
17.

Which of the following sorting algorithms does not have a worst case time complexity of O(\(n^2\))?

A. Insertion sort
B. merge sort
C. quick sort
D. bubble sort
Answer» C. quick sort
18.

Using overlapped(Parallel) access, which of the following is the effective average access time for a two-level memory, if cache memory access time is 160ns and memory access time is 600 ns and the hit ratio for cache memory is h = 0.9? [Assume every time we go to main memory we’ll get the data we want.]

A. 204ns
B. 226ns
C. 216ns
D. 206ns
Answer» B. 226ns
19.

The register which contains the data to be written into or read out of the addressed location is called :

A. Index register
B. Memory address register
C. Memory Data register
D. Program Counter
Answer» D. Program Counter
20.

What is the difference between const char *p and char * const p ?

A. const char *p – This declares ‘p’ to be a constant pointer to a char. (Char p is modifiable but the pointer isn’t) char * const p – Pointer to a Constant char (‘p’ isn’t modifiable but the pointer is)
B. const char *p – Pointer to a Constant char (‘p’ isn’t modifiable but the pointer is) char * const p – This declares ‘p’ to be a constant pointer to an char. (Char p is modifiable but the pointer isn’t)
C. const char *p – Constant char Pointer (‘p’ and pointer both are modifiable) char * const p – This declares ‘p’ to be a pointer to an constant char. (Char p is modifiable but the pointer isn’t)
D. Since const char and char const is the same, there is no difference.
Answer» C. const char *p – Constant char Pointer (‘p’ and pointer both are modifiable) char * const p – This declares ‘p’ to be a pointer to an constant char. (Char p is modifiable but the pointer isn’t)
21.

What would be the output of the following code? #include <stdio.h> int main() { int x = 4, y, z; y = --x; z = x--; printf("%d%d%d", x, y, z); return 0; }

A. 233
B. 223
C. 323
D. 322
Answer» B. 223
22.

What would be the output of the below code? #include <iostream> using namespace std; #define VALUE 10 int main() { int RESULT; RESULT = ++VALUE; cout << RESULT; return 0; }

A. 10
B. 11
C. compile time error
D. run time error
Answer» D. run time error
23.

Consider the following for Loop : for(putchar(‘ c ‘ ) ; putchar( 0 ) ; putchar( ‘ d ‘ )) putchar(‘ e ‘); How many times the above for loop will execute?

A. 0 times
B. 1 times
C. infinite times
D. Will not execute due to syntax error
Answer» B. 1 times
24.

reak Statement is used to exit :

A. from the innermost loop only.
B. from all the loops & switches.
C. only from the innermost switch.
D. from the innermost loop or switch.
Answer» E.
25.

…………… is a large operating system core provides a wide range of services.

A. Multilithic kernel
B. Monolithic kernel
C. Micro kernel
D. Macro kernel
Answer» E.
26.

…………… is a large kernel containing virtually the complete operating system, including, scheduling, file system, device drivers and memory management.

A. Multilithic kernel
B. Monolithic kernel
C. Micro kernel
D. Macro kernel
Answer» C. Micro kernel
27.

………………….. provides a larger sized of virtual memory but require virtual memory which provides multidimensional memory.

A. Paging method
B. Segmentation method
C. Paging and segmentation method
D. None of these
Answer» C. Paging and segmentation method
28.

With ……………. a page is brought into main memory only when the reference is made to a location on that page.

A. demand paging
B. main paging
C. prepaging
D. postpaging
Answer» B. main paging
29.

……………… executes must frequently and makes the fine grained decision of which process to execute the next.

A. Long-term scheduling
B. Medium-term scheduling
C. Short-term scheduling
D. None of the above
Answer» D. None of the above
30.

Which of the following is/are the functions of operating system? i) Sharing hardware among users.            ii) Allowing users to share data among themselves. iii) Recovering from errors.                        iv) Preventing users from interfering with one another. v) Scheduling resources among users.

A. i, ii, iii and iv only
B. ii, iii, iv and v only
C. i, iii, iv and v only
D. All i, ii, iii, iv and v
Answer» E.
31.

State True or False. i) In spooling high speed device like a disk is interposed between running program and low-speed device in Input/output. ii) By using spooling for example instead of writing directly to a printer, outputs are written to the disk.

A. i-True, ii-False
B. i-True, ii-True
C. i-False, ii-True
D. i-False, ii-False
Answer» C. i-False, ii-True
32.

In …………. generation of operating system, operating system designers develop the concept of multi-programming in which several jobs are in main memory at once.

A. First
B. Second
C. Third
D. Fourth
Answer» D. Fourth
33.

The system of …………… generally ran one job at a time. These were called single stream batch processing.

A. 40’s
B. 50’s
C. 60’s
D. 70’s
Answer» C. 60’s
34.

Which of the following is/ are the part of operating system?

A. Kernel services
B. Library services
C. Application level services
D. All of the above
Answer» E.
35.

Queue can be used to implement

A. radix sort
B. In-order
C. recursion
D. depth first search
Answer» B. In-order
36.

Pre-order is same as

A. depth-first order
B. topological order
C. breadth-first order
D. linear order
Answer» B. topological order
37.

The depth of a complete binary tree with ‘n’ nodes is (log is to the base two)

A. log(n+l) – 1
B. log(n-1) + 1
C. log(n)
D. log(n) + 1
Answer» B. log(n-1) + 1
38.

 binary tree in which every non-leaf node has non-empty left and right subtrees is called a strictly binary tree. Such a tree with 10 leaves

A. cannot have more than 19 nodes
B. has exactly 17 nodes
C. has exactly 19 nodes
D. cannot have more than 17 nodes
Answer» D. cannot have more than 17 nodes
39.

If the sequence of operations push(1), push(2), pop,push (1),push(2), pop, pop, pop, push (2), pop are performed on a stack, the sequence of popped out values are

A. 2, 2, 1, 1, 2
B. 2, 2, 1, 2, 2
C. 2,1, 2, 2, 2
D. 2, 1, 2, 2, 1
Answer» B. 2, 2, 1, 2, 2
40.

Given two sorted list of size ‘m and ‘n’ respectively. The number of comparisons needed in the worst case by the merge sort algorithm will be

A. m x n
B. minimum of m, n
C. maximum of m, n
D. m+n-1
Answer» E.
41.

The number of swapping needed to sort the numbers 8, 22, 7, 9, 31, 19, 5, 13 in ascending order, using bubble sort is

A. 11
B. 12
C. 13
D. 14
Answer» E.
42.

The number of possible ordered trees with 3 nodes А,В,С is

A. 16
B. 12
C. 5
D. 10
Answer» D. 10
43.

The initial configuration of a queue is a, b, c, d, (‘a’ is in the front end). To get the configuration d, c,b, a, one needs a minimum of

A. 2 deletions and 3 additions
B. 3 deletions and 3 additions
C. 3 deletions and 2 additions
D. 3 deletions and 4 additions
Answer» C. 3 deletions and 2 additions
44.

What is function of logic gate?

A. It makes logic decisions
B. It works on binary algebra
C. It alternates between 0 and 1 values
D. None of these
Answer» B. It works on binary algebra
45.

What is a the output signal when the input to NOT gate is A=11100?

A. 00000
B. 00011
C. 11111
D. None of these
Answer» E.