Aspire's Library

A Place for Latest Exam wise Questions, Videos, Previous Year Papers,
Study Stuff for MCA Examinations

WB JECA MCA Previous Year Questions (PYQs)

WB JECA MCA 2023 PYQ


WB JECA MCA PYQ 2023
Find out the wrong statement based on the characteristics of AVL tree data structure.






Go to Discussion

WB JECA MCA Previous Year PYQ WB JECA MCA JECA MCA 2023 PYQ

Solution

 AVL trees guarantee O(log n) search time, not O(n).


WB JECA MCA PYQ 2023
Example of non-linear data structure is __________.






Go to Discussion

WB JECA MCA Previous Year PYQ WB JECA MCA JECA MCA 2023 PYQ

Solution

Graphs and trees are non-linear data structures, while linked-list, queue, and stack are linear.


WB JECA MCA PYQ 2023
Bubble sort algorithm has a worst-case time complexity of __________.





Go to Discussion

WB JECA MCA Previous Year PYQ WB JECA MCA JECA MCA 2023 PYQ

Solution

Graphs and trees are non-linear data structures, while linked-list, queue, and stack are linear.


WB JECA MCA PYQ 2023
Insertion sort algorithm has a best-case time complexity of __________.






Go to Discussion

WB JECA MCA Previous Year PYQ WB JECA MCA JECA MCA 2023 PYQ

Solution

Insertion sort runs in O(n) time when the array is already sorted (best case).


WB JECA MCA PYQ 2023
In machine learning, VC dimension is used to measure the capacity of a set of functions.  
VC means __________.  






Go to Discussion

WB JECA MCA Previous Year PYQ WB JECA MCA JECA MCA 2023 PYQ

Solution

VC dimension stands for Vapnik–Chervonenkis dimension, a measure of model capacity/complexity.


WB JECA MCA PYQ 2023
Artificial Neural networks are __________ algorithms.  






Go to Discussion

WB JECA MCA Previous Year PYQ WB JECA MCA JECA MCA 2023 PYQ

Solution

Artificial Neural Networks (ANNs) are computational algorithms inspired by biological neural networks.


WB JECA MCA PYQ 2023
One-class SVM is __________ algorithm.  





Go to Discussion

WB JECA MCA Previous Year PYQ WB JECA MCA JECA MCA 2023 PYQ

Solution

One-class SVM is mainly used for anomaly/outlier detection, which falls under unsupervised learning.


WB JECA MCA PYQ 2023
Time complexity of K-Means clustering is __________.  






Go to Discussion

WB JECA MCA Previous Year PYQ WB JECA MCA JECA MCA 2023 PYQ

Solution

For K-Means, the time complexity per iteration is O(kN), where k = number of clusters and N = number of data points.


WB JECA MCA PYQ 2023
__________ algorithm is used to find out the shortest path between two points in a connected weighted graph.  






Go to Discussion

WB JECA MCA Previous Year PYQ WB JECA MCA JECA MCA 2023 PYQ

Solution

Kruskal’s algorithm (and Prim’s) are used in shortest path/minimum spanning tree problems.


WB JECA MCA PYQ 2023
Forward–backward algorithm is used in case of HMM to compute __________ of all hidden state variables.  






Go to Discussion

WB JECA MCA Previous Year PYQ WB JECA MCA JECA MCA 2023 PYQ

Solution

The forward–backward algorithm in Hidden Markov Models (HMM) is used to compute posterior marginals over hidden states.


WB JECA MCA PYQ 2023
HMM is a specific instance of CRF which is known as __________.  






Go to Discussion

WB JECA MCA Previous Year PYQ WB JECA MCA JECA MCA 2023 PYQ

Solution

Hidden Markov Model (HMM) is a probabilistic model and can be seen as a special case of Conditional Random Fields (CRF).


WB JECA MCA PYQ 2023
In FP-Growth Algorithm, FP means __________





Go to Discussion

WB JECA MCA Previous Year PYQ WB JECA MCA JECA MCA 2023 PYQ

Solution

In FP-Growth, FP stands for Frequent Pattern, used in association rule mining.


WB JECA MCA PYQ 2023
In software engineering, what is the full form for PERT chart?  






Go to Discussion

WB JECA MCA Previous Year PYQ WB JECA MCA JECA MCA 2023 PYQ

Solution

Program Evaluation and Review Technique


WB JECA MCA PYQ 2023
In software engineering, the testing performed by development team is known as ______.  






Go to Discussion

WB JECA MCA Previous Year PYQ WB JECA MCA JECA MCA 2023 PYQ

Solution

Alpha testing is performed internally by the development team before releasing the software for beta testing.


WB JECA MCA PYQ 2023
In software engineering, a prototyping model can be used when __________.  





Go to Discussion

WB JECA MCA Previous Year PYQ WB JECA MCA JECA MCA 2023 PYQ

Solution

Technical solutions are unclear to the development team


WB JECA MCA PYQ 2023
60.In classical waterfall model, which phase comes before the design phase?  






Go to Discussion

WB JECA MCA Previous Year PYQ WB JECA MCA JECA MCA 2023 PYQ

Solution

Requirements analysis and specification


WB JECA MCA PYQ 2023
In software engineering, which of the following is not a type of cohesion?






Go to Discussion

WB JECA MCA Previous Year PYQ WB JECA MCA JECA MCA 2023 PYQ

Solution

Projection” is not a type of cohesion.


WB JECA MCA PYQ 2023
In software engineering, which of the following is not a type of coupling?






Go to Discussion

WB JECA MCA Previous Year PYQ WB JECA MCA JECA MCA 2023 PYQ

Solution

Coupling types are Data, Stamp, Control, Common, Content.
“Connection” is not a coupling type.


WB JECA MCA PYQ 2023
Choose the correct option as the activities of the first quadrant of Spiral model.






Go to Discussion

WB JECA MCA Previous Year PYQ WB JECA MCA JECA MCA 2023 PYQ

Solution

Determine objectives, alternatives and constraints


WB JECA MCA PYQ 2023
 Choose the appropriate black-box testing technique in software engineering.






Go to Discussion

WB JECA MCA Previous Year PYQ WB JECA MCA JECA MCA 2023 PYQ

Solution

Boundary Value Analysis (BVA) is a black-box testing technique used to check inputs at their boundary values.


WB JECA MCA PYQ 2023
In User Datagram packet format, the size of the header is ________.






Go to Discussion

WB JECA MCA Previous Year PYQ WB JECA MCA JECA MCA 2023 PYQ

Solution

The UDP header is 8 bytes (64 bits) long — containing source port, destination port, length, and checksum.


WB JECA MCA PYQ 2023
Transmission Control Protocol (TCP) offers __________ service in which data can flow in both directions at the same time.






Go to Discussion

WB JECA MCA Previous Year PYQ WB JECA MCA JECA MCA 2023 PYQ

Solution

TCP provides a full-duplex service — meaning data can flow simultaneously in both directions.


WB JECA MCA PYQ 2023
Example of a two-layer switch is ____________.






Go to Discussion

WB JECA MCA Previous Year PYQ WB JECA MCA JECA MCA 2023 PYQ

Solution

A bridge operates at Layer 2 (Data Link Layer) and is considered a two-layer switch.


WB JECA MCA PYQ 2023
A ____________ routing table contains information entered manually.






Go to Discussion

WB JECA MCA Previous Year PYQ WB JECA MCA JECA MCA 2023 PYQ

Solution

A static routing table is manually configured by the administrator.


WB JECA MCA PYQ 2023
BOOTP is ____________ layer protocol.
(A) application
(B) physical
(C) network
(D) datalink





Go to Discussion

WB JECA MCA Previous Year PYQ WB JECA MCA JECA MCA 2023 PYQ

Solution

BOOTP (Bootstrap Protocol) works at the application layer of the OSI model.


WB JECA MCA PYQ 2023
ICMP always reports error messages to the original ____________.






Go to Discussion

WB JECA MCA Previous Year PYQ WB JECA MCA JECA MCA 2023 PYQ

Solution

ICMP error messages are always sent back to the source of the packet.


WB JECA MCA PYQ 2023
The ____________ program uses ICMP messages and TTL field in IP packet to find route.






Go to Discussion

WB JECA MCA Previous Year PYQ WB JECA MCA JECA MCA 2023 PYQ

Solution

traceroute uses ICMP Echo and TTL fields to determine the route to a destination.


WB JECA MCA PYQ 2023
SNMP is ____________ level protocol.






Go to Discussion

WB JECA MCA Previous Year PYQ WB JECA MCA JECA MCA 2023 PYQ

Solution

SNMP (Simple Network Management Protocol) is an application layer protocol.


WB JECA MCA PYQ 2023
Which key can be derived directly from a Super Key?






Go to Discussion

WB JECA MCA Previous Year PYQ WB JECA MCA JECA MCA 2023 PYQ

Solution

A Candidate Key is derived from a Super Key, and then one candidate key is chosen as the Primary Key.


WB JECA MCA PYQ 2023
Relational Algebra is ____________ query language.






Go to Discussion

WB JECA MCA Previous Year PYQ WB JECA MCA JECA MCA 2023 PYQ

Solution

Relational Algebra is a procedural query language because it specifies the operations to obtain the result.


WB JECA MCA PYQ 2023
 In case of union compatibility, ____________






Go to Discussion

WB JECA MCA Previous Year PYQ WB JECA MCA JECA MCA 2023 PYQ

Solution

For union compatibility, two relations must have the same set of attributes and domains.


WB JECA MCA PYQ 2023
Which option cannot be used with “ALTER table” command in SQL ?






Go to Discussion

WB JECA MCA Previous Year PYQ WB JECA MCA JECA MCA 2023 PYQ

Solution

ALTER TABLE can ADD, MODIFY, and DROP columns, but DELETE is a DML operation, not part of ALTER.


WB JECA MCA PYQ 2023
Third normal form (3NF) removes ____________ from a relation.






Go to Discussion

WB JECA MCA Previous Year PYQ WB JECA MCA JECA MCA 2023 PYQ

Solution

3NF eliminates transitive dependencies.


WB JECA MCA PYQ 2023
Which option is not a step for query processing ?






Go to Discussion

WB JECA MCA Previous Year PYQ WB JECA MCA JECA MCA 2023 PYQ

Solution

Metadata organization is not a query processing step.


WB JECA MCA PYQ 2023
Which of the following option is not a transaction state ?






Go to Discussion

WB JECA MCA Previous Year PYQ WB JECA MCA JECA MCA 2023 PYQ

Solution

Transaction states are Active, Partially committed, Failed, Aborted, Terminated. There is no "Updated" state.


WB JECA MCA PYQ 2023
Which of the following option does not have any partial functional dependencies ?






Go to Discussion

WB JECA MCA Previous Year PYQ WB JECA MCA JECA MCA 2023 PYQ

Solution

2NF removes partial dependency.


WB JECA MCA PYQ 2023
What is the output of the following program ? 
#include void main ( ) 
 { 
 int a = 40; float b; 
 b = ++a; 
 printf(“%d, %f ”, a, ++b); 
 }





Go to Discussion

WB JECA MCA Previous Year PYQ WB JECA MCA JECA MCA 2023 PYQ

Solution


WB JECA MCA PYQ 2023

What is the output of the following C program?

#include <stdio.h>
void main(){
  int a = -7;
  float b;
  b = a++;
  printf("%d, %f ", a, ++b);
}





Go to Discussion

WB JECA MCA Previous Year PYQ WB JECA MCA JECA MCA 2023 PYQ

Solution

Explanation: The statement b = a++; assigns the current value of a (−7) to b and then increments a to −6. Later, ++b increments b from −7 to −6 before printing. $$ a = -6,\quad b = -6.000000 $$

WB JECA MCA PYQ 2023

What is the output?

#include <stdio.h>
void main(){
  int i = -1;
  printf("sizeof(i) = %d", sizeof(i));
}





Go to Discussion

WB JECA MCA Previous Year PYQ WB JECA MCA JECA MCA 2023 PYQ

Solution

Explanation: The operator sizeof gives the size of the type in bytes, not the value. On most 32-bit and 64-bit systems, sizeof(int) is 4. $$ \text{Output: } \texttt{sizeof(i) = 4} $$

WB JECA MCA PYQ 2023

What is the output?

#include <stdio.h>
void main(){
  int x = -1, y = 1, z = 0;
  if(x && y++ && z)
    ++x, y++, --z;
  printf("%d, %d, %d", x++, y++, z++);
}





Go to Discussion

WB JECA MCA Previous Year PYQ WB JECA MCA JECA MCA 2023 PYQ

Solution

Explanation: In the condition x && y++ && z, since z = 0, the logical AND short-circuits and the body of the if is not executed. However, y++ is evaluated before the short-circuit, so y becomes 2. Values before printing: $$ x = -1,\ y = 2,\ z = 0 $$ So the program prints: $$ (-1,\ 2,\ 0) $$

WB JECA MCA PYQ 2023

What is the output?

#include <stdio.h>
enum colors{RED, BROWN, ORANGE};
void main(){
  printf("%ld..%f..%d", RED, BROWN, ORANGE);
}





Go to Discussion

WB JECA MCA Previous Year PYQ WB JECA MCA JECA MCA 2023 PYQ

Solution

Explanation: The format specifiers do not match the data types (%f is used for int). This causes undefined behavior. The program may compile, but the output is not reliable. Correct choice: None of these.

WB JECA MCA PYQ 2023

What is the output?

#include <stdio.h>
void main(){
  char M = 'M';
  printf("%d, %c", M, M);
}





Go to Discussion

WB JECA MCA Previous Year PYQ WB JECA MCA JECA MCA 2023 PYQ

Solution

Explanation: The character 'M' has an ASCII value of 77. So printing with %d shows 77, and %c shows M. $$ \text{Output: } 77,\ M $$

WB JECA MCA PYQ 2023

What is the output?

#include <stdio.h>
void main(){
  int i = -9;
  printf("%d %d %d", i++, ++i, ++i);
}





Go to Discussion

WB JECA MCA Previous Year PYQ WB JECA MCA JECA MCA 2023 PYQ

Solution

Ek hi expression me variable i par multiple modifications → C standard me undefined behavior.
Isliye koi fixed output/compile error guarantee nahi. Sahi option: None of these.

WB JECA MCA PYQ 2023

What is the output?

#include <stdio.h>
void main(){
  int **ptr;
  int temp = 65;
  ptr[0] = &temp;
  printf("%d", ptr[0][0]);
}





Go to Discussion

WB JECA MCA Previous Year PYQ WB JECA MCA JECA MCA 2023 PYQ

Solution

Explanation: The pointer ptr is uninitialized, so it does not point to valid memory. When the code tries to access ptr[0], it attempts to dereference an invalid location. This leads to undefined behavior, and in most cases results in a segmentation fault.

WB JECA MCA PYQ 2023

What is the output?

#include <stdio.h>
#include <stdlib.h>
void main(){
  int *ptr;
  ptr = (int*) calloc(3, sizeof(int));
  ptr[2] = 30;
  printf("%d", *ptr);
  free(ptr);
}





Go to Discussion

WB JECA MCA Previous Year PYQ WB JECA MCA JECA MCA 2023 PYQ

Solution

Explanation: The function calloc initializes all allocated memory blocks with zero. So ptr[0] is initialized to 0. The statement *ptr is equivalent to ptr[0]. $$ \text{Output: } 0 $$

WB JECA MCA PYQ 2023

__________ interrupt may happen due to power failure.






Go to Discussion

WB JECA MCA Previous Year PYQ WB JECA MCA JECA MCA 2023 PYQ

Solution

Power failure ⇒ Hardware interrupt.

WB JECA MCA PYQ 2023

11. Address of the next instruction to be executed is specified by ______________.

(A) MBR   (B) MAR   (C) PSW   (D) PC






Go to Discussion

WB JECA MCA Previous Year PYQ WB JECA MCA JECA MCA 2023 PYQ

Solution

Explanation: The Program Counter (PC) holds the address of the next instruction to be fetched and executed.

WB JECA MCA PYQ 2023

12. Auxiliary memory is also known as ______________ memory.

(A) Primary   (B) Secondary   (C) Binary   (D) Quad






Go to Discussion

WB JECA MCA Previous Year PYQ WB JECA MCA JECA MCA 2023 PYQ

Solution

Explanation: Auxiliary storage refers to secondary memory (e.g., HDD, SSD, tapes) used for non-volatile, large-capacity storage.

WB JECA MCA PYQ 2023

13. BIOS means ______________.

(A) basic input/output system   (B) best input/output system   (C) basic input system   (D) basic output system






Go to Discussion

WB JECA MCA Previous Year PYQ WB JECA MCA JECA MCA 2023 PYQ

Solution

Explanation: BIOS stands for Basic Input/Output System, firmware that initializes hardware and starts the boot process.

WB JECA MCA PYQ 2023

14. _________ is the most appropriate scheduling in case of a time-shared operating system.

(A) FCFS   (B) RR   (C) SJF   (D) SRTF






Go to Discussion

WB JECA MCA Previous Year PYQ WB JECA MCA JECA MCA 2023 PYQ

Solution

Explanation: Time-sharing systems aim for responsiveness and fairness, which is best provided by Round Robin (RR) using time quanta.

WB JECA MCA PYQ 2023

15. If only one process can be able to access a particular resource at a time, then it is known as ______________.

(A) Mutual execution   (B) Mutual exclusion   (C) Multiple execution   (D) Multiple exclusion






Go to Discussion

WB JECA MCA Previous Year PYQ WB JECA MCA JECA MCA 2023 PYQ

Solution

Explanation: Allowing only one process to access a resource at a time is called mutual exclusion (mutex).

WB JECA MCA PYQ 2023

16. Resource allocation graph is used to represent ______________.

(A) deadlock   (B) virtual memory   (C) main memory   (D) scheduling






Go to Discussion

WB JECA MCA Previous Year PYQ WB JECA MCA JECA MCA 2023 PYQ

Solution

Explanation: Resource Allocation Graph (RAG) models processes and resources; cycles in certain cases indicate deadlock.

WB JECA MCA PYQ 2023

17. Banker’s algorithm for resource allocation deals with ______________.

(A) mutual exclusion   (B) mutual inclusion   (C) deadlock recovery   (D) deadlock avoidance






Go to Discussion

WB JECA MCA Previous Year PYQ WB JECA MCA JECA MCA 2023 PYQ

Solution

Explanation: Banker’s algorithm is a deadlock avoidance algorithm ensuring the system stays in a safe state.

WB JECA MCA PYQ 2023

18. Page fault means ______________.

(A) required page is available in main memory   (B) required page is not available in main memory   (C) segment number   (D) reduce page I/O






Go to Discussion

WB JECA MCA Previous Year PYQ WB JECA MCA JECA MCA 2023 PYQ

Solution

Explanation: A page fault occurs when the referenced page is not present in main memory, forcing a page-in from secondary storage.

WB JECA MCA PYQ 2023

19. ___________ is a technique to move a process from main memory to secondary memory.

(A) Deadlock   (B) Synchronization   (C) Caching   (D) Swapping






Go to Discussion

WB JECA MCA Previous Year PYQ WB JECA MCA JECA MCA 2023 PYQ

Solution

Explanation: Swapping transfers processes between main memory and secondary storage to manage memory pressure.

WB JECA MCA PYQ 2023

20. Demand paging is considered as ______________.

(A) fetching a page when not needed   (B) switching between two processes   (C) fetching a page only when needed   (D) switching between two threads






Go to Discussion

WB JECA MCA Previous Year PYQ WB JECA MCA JECA MCA 2023 PYQ

Solution

Explanation: In demand paging, a page is loaded into memory only when it is actually referenced.

WB JECA MCA PYQ 2023

21. Thrashing means a condition having ______________.

(A) minimum paging   (B) optimized paging   (C) synchronized paging   (D) excessive paging






Go to Discussion

WB JECA MCA Previous Year PYQ WB JECA MCA JECA MCA 2023 PYQ

Solution

Explanation: Thrashing occurs when the system spends most time paging due to insufficient frames, causing excessive paging and poor performance.

WB JECA MCA PYQ 2023

22. A counting semaphore is initialized to 15. Then, 4 wait operations and 2 signal operations are completed on this semaphore. The resulting value of the semaphore is ____________.

(A) 11   (B) 13   (C) 17   (D) 19






Go to Discussion

WB JECA MCA Previous Year PYQ WB JECA MCA JECA MCA 2023 PYQ

Solution

Explanation: Each wait (P) decrements; each signal (V) increments. Initial: 15 → after 4 waits: 11 → after 2 signals: 13. $$ 15 - 4 + 2 = 13 $$

WB JECA MCA PYQ 2023

23. What do you mean by fork()? Choose the correct option.

(A) Starvation   (B) Creation of new task   (C) Demand paging   (D) Semaphore






Go to Discussion

WB JECA MCA Previous Year PYQ WB JECA MCA JECA MCA 2023 PYQ

Solution

Explanation: fork() creates a new process (child) as a copy of the calling process.

WB JECA MCA PYQ 2023

24. In file management, FAT means ______________.

(A) Feature Access Table   (B) File Access Table   (C) Fault Allocation Table   (D) File Allocation Table






Go to Discussion

WB JECA MCA Previous Year PYQ WB JECA MCA JECA MCA 2023 PYQ

Solution

Explanation: FAT stands for File Allocation Table, a file system layout used to map files to disk clusters.

WB JECA MCA PYQ 2023
25.What is the output of the following program ?  include <iostream>  using namespace std;  int addition (int a, int b)  {   return a+b;  }  double addition (double a, double b)  {   return a+b;  }  int main ()  {   cout<< addition (35,20) << “;”;   cout<< addition (34.1,12.7);   return 0;  } 





Go to Discussion

WB JECA MCA Previous Year PYQ WB JECA MCA JECA MCA 2023 PYQ

Solution

The given program defines two overloaded functions `addition`:  
1. `int addition(int a, int b)` → returns integer sum  
2. `double addition(double a, double b)` → returns double sum  

In `main()`:
- `addition(35,20)` calls the integer version → 35 + 20 = 55  
- `addition(34.1,12.7)` calls the double version → 34.1 + 12.7 = 46.8  

Therefore, the output is:  
55;46.8


WB JECA MCA PYQ 2023
26.What is the output of the following program ?  #include <iostream>  using namespace std;  template <class C1, class C2>  bool is_equal (C1 var1, C2 var2)  {   return (var1 = = var2);  }  int main ()  {   if (is_equal(10,10.0))    cout<< “Equal”;   else    cout<< “Not equal”;   return 0;  } 





Go to Discussion

WB JECA MCA Previous Year PYQ WB JECA MCA JECA MCA 2023 PYQ

Solution

The function `is_equal` is a template that compares two variables of possibly different types.  
In `main()`, we call `is_equal(10, 10.0)`.  

- `10` is an integer (int).  
- `10.0` is a double.  
C++ allows implicit type conversion during comparison.  
So, `10 == 10.0` evaluates to `true`.  

Therefore, the condition in the `if` statement is true, and the output will be:  

Equal


WB JECA MCA PYQ 2023
26.What is the output of the following program ?

#include <iostream>
using namespace std;

int main() 
{
    int var = 0;
    while (var < 10) 
    {
        cout << var << " ";
        var++;
    }
    cout << var;
    return 0;
}






Go to Discussion

WB JECA MCA Previous Year PYQ WB JECA MCA JECA MCA 2023 PYQ

Solution

Output:
0 1 2 3 4 5 6 7 8 9 10

Explanation:

  • The variable var starts at 0.

  • The while (var < 10) loop prints 0 1 2 3 4 5 6 7 8 9 with spaces.

  • When var reaches 10, the loop stops.

  • After the loop, cout << var; prints 10.

    Final output:

    0 1 2 3 4 5 6 7 8 9 10


WB JECA MCA PYQ 2023
What is the output of the following program ?
#include <iostream>
using namespace std;
struct demo
{
    int var;
};
int main()
{
    demo str;
    demo *ptr;

    str.var = 100;
    ptr = &str;
    cout << ptr->var;
    return 0;
}






Go to Discussion

WB JECA MCA Previous Year PYQ WB JECA MCA JECA MCA 2023 PYQ

Solution

Output:
100
Explanation:

str.var = 100; assigns 100 to the structure variable.

ptr = &str; makes the pointer point to str.

ptr->var accesses the member var of structure str via pointer.

Hence it prints 100.


WB JECA MCA PYQ 2023
29.What is the output of the following program ?
#include <iostream>
using namespace std;
int main ()
{
    int c1 = 10;
    int c2 = 20;
    {
        int c1;
        c1 = 50;
        c2 = 50;
        cout << "c1= " << c1 << ", c2=" << c2;
    }
    cout << ", c1= " << c1 << ", c2=" << c2;
    return 0;
}






Go to Discussion

WB JECA MCA Previous Year PYQ WB JECA MCA JECA MCA 2023 PYQ

Solution

  • Output:
    c1= 50, c2=50, c1= 10, c2=50
    Explanation:

    Outer c1 = 10, c2 = 20.

    Inside the inner block, a new local c1 is declared (shadowing outer c1).

    Inner c1 = 50, and c2 (outer one) is updated to 50.

    First cout prints → c1= 50, c2=50.

    After the block ends, inner c1 is destroyed. Outer c1 remains 10, while outer c2 is 50.

    Second cout prints → , c1= 10, c2=50.

    ? Final output: c1= 50, c2=50, c1= 10, c2=50.


WB JECA MCA PYQ 2023
30.What is the output of the following program ?
#include <iostream>
using namespace std;

class Demo {
public:
    static int count;
    Demo() { count++; }
};

int Demo::count = 0;

int main() {
    Demo var1;
    Demo var2[5];
    cout << var1.count;
    return 0;
}






Go to Discussion

WB JECA MCA Previous Year PYQ WB JECA MCA JECA MCA 2023 PYQ

Solution

  • Explanation:

    • int Demo::count = 0; initializes the static variable count to 0.

    • Demo var1; → constructor is called once → count = 1.

    • Demo var2[5]; → constructor is called 5 times (for each element in the array) → count = 6.

    • Since count is static, it is shared among all objects.

    • Finally, cout << var1.count; prints 6.

    ? Correct answer: (A) 6


WB JECA MCA PYQ 2023
31.What is the output of the following program ?
#include <iostream>
using namespace std;

void print();
int main()
{
    int var = 0;
    var = print();
    cout << var;
    return 0;
}

void print()
{
    cout << "Hi";
}






Go to Discussion

WB JECA MCA Previous Year PYQ WB JECA MCA JECA MCA 2023 PYQ

Solution

  • Explanation:

    • print() is declared as void print().

    • In main(), the statement var = print(); tries to assign the return value of print() to an int variable.

    • But since print() has no return value (void), this causes a compile-time error.

    Hence, the program does not compile.


WB JECA MCA PYQ 2023
32.What is the output of the following program ?
#include <iostream>
using namespace std;

int main()
{
    int var = 2;
    do
    {
        cout << var;
    } while (var--);
    return 0;
}






Go to Discussion

WB JECA MCA Previous Year PYQ WB JECA MCA JECA MCA 2023 PYQ

Solution

  • Explanation:

    • Initially var = 2.

    • First iteration: prints 2, then var-- makes var = 1.

    • Second iteration: prints 1, then var-- makes var = 0.

    • Third iteration: prints 0, then var-- makes var = -1. Condition fails and loop exits.

    So output is:


WB JECA MCA PYQ 2023
33.In shell script, which command is used to create a new directory ? 





Go to Discussion

WB JECA MCA Previous Year PYQ WB JECA MCA JECA MCA 2023 PYQ

Solution

  • mkdir is the command to create a new directory in Unix/Linux.


WB JECA MCA PYQ 2023
34.In shell script, which command is used to copy a file?






Go to Discussion

WB JECA MCA Previous Year PYQ WB JECA MCA JECA MCA 2023 PYQ

Solution

  • cp is used to copy files or directories in Unix/Linux.


WB JECA MCA PYQ 2023
35.In shell script, which command is used to delete a file?





Go to Discussion

WB JECA MCA Previous Year PYQ WB JECA MCA JECA MCA 2023 PYQ

Solution

  • rm is the command to remove/delete files in Unix/Linux.


WB JECA MCA PYQ 2023
36.In Unix/Linux platform, which command is used to find out the difference between two files?





Go to Discussion

WB JECA MCA Previous Year PYQ WB JECA MCA JECA MCA 2023 PYQ

Solution

  • diff compares two files line by line and shows differences.


WB JECA MCA PYQ 2023
37.In Unix/Linux platform, which command is used to create a symbolic link?





Go to Discussion

WB JECA MCA Previous Year PYQ WB JECA MCA JECA MCA 2023 PYQ

Solution

  • ln -s is used to create symbolic (soft) links in Linux.


WB JECA MCA PYQ 2023
38.In Unix/Linux platform, which command is used to view the inode number of a file?





Go to Discussion

WB JECA MCA Previous Year PYQ WB JECA MCA JECA MCA 2023 PYQ

Solution

  • ls -i displays the inode number of each file.


WB JECA MCA PYQ 2023
39.In Unix/Linux platform, which command is used to specify the access mode for files?





Go to Discussion

WB JECA MCA Previous Year PYQ WB JECA MCA JECA MCA 2023 PYQ

Solution

  • chmod is used to change file permissions (read/write/execute).


WB JECA MCA PYQ 2023
40.In Unix/Linux platform, ______ command is used to show current running processes.





Go to Discussion

WB JECA MCA Previous Year PYQ WB JECA MCA JECA MCA 2023 PYQ

Solution

  • ps shows the list of currently running processes.


WB JECA MCA PYQ 2023
41.In singly linked list, the time complexity for insertion at a particular node is:






Go to Discussion

WB JECA MCA Previous Year PYQ WB JECA MCA JECA MCA 2023 PYQ

Solution

  • Insertion after a given node in a linked list takes constant time O(1) (if pointer to that node is already available).



WB JECA MCA PYQ 2023
42.In stack data structure, __________ operation is not permitted.






Go to Discussion

WB JECA MCA Previous Year PYQ WB JECA MCA JECA MCA 2023 PYQ

Solution

Enqueue is a queue operation, not allowed in stack.

WB JECA MCA PYQ 2023
43.In tree data structure, the in-degree of root node is always __________.






Go to Discussion

WB JECA MCA Previous Year PYQ WB JECA MCA JECA MCA 2023 PYQ

Solution

The root node has no incoming edges, so its in-degree is always 0.

WB JECA MCA PYQ 2023
44.In binary tree data structure, using depth-first approach, preorder traversal means _______.






Go to Discussion

WB JECA MCA Previous Year PYQ WB JECA MCA JECA MCA 2023 PYQ

Solution

Preorder traversal visits root first, then left subtree, then right subtree.



WB JECA MCA


Online Test Series,
Information About Examination,
Syllabus, Notification
and More.

Click Here to
View More

WB JECA MCA


Online Test Series,
Information About Examination,
Syllabus, Notification
and More.

Click Here to
View More

Ask Your Question or Put Your Review.

loading...