0%
67

1 / 20

Category: ( C++ )

1. What is the result of this code?

#include

int main() {

int x = 10, y = 20;

std::swap(x, y);

std::cout << x << " " << y; return 0; }

2 / 20

Category: ( C++ )

2. What is the output of this program?

#include

void print() { std::cout << "Hello"; } int main() { print(); return 0; }

3 / 20

Category: ( C++ )

3. What does mutable keyword do?

4 / 20

Category: (Java)

4. Which of these classes is not synchronized?

5 / 20

Category: ( C++ )

5. Which of these is NOT a property of std::shared_ptr?

6 / 20

Category: (Java)

6. A car rental system has a Vehicle class with subclasses like Car and Bike. If Vehicle cannot be instantiated, which feature is being used?

7 / 20

Category: ( C++ )

7. What is the primary difference between delete and delete[]?

8 / 20

Category: ( C )

8. What does this code print?

#include

int main() {

printf("%d", sizeof('A'));

return 0;

}

9 / 20

Category: (Java)

9. What is the output of the following code?
java
class Test {
public static void main(String[] args) {
int[][] arr = {{1, 2}, {3, 4}};
System.out.println(arr[1][1]);
}
}

10 / 20

Category: ( C++ )

10. What is the output of this code?

int a = 5;

int b = a++;

std::cout << a << " " << b;

11 / 20

Category: (Java)

11. Which of the following statements about HashMap is true?

12 / 20

Category: ( C++ )

12. What is the output of this code?

int x = 5;

int &y = x;

y = 10;

std::cout << x;

13 / 20

Category: ( C )

13. What is the value of the expression 5 && 0 || 3 && 4?

14 / 20

Category: (Java)

14. In an ecommerce system, you want to hide sensitive user details like passwords. Which OOP principle helps achieve this?

15 / 20

Category: ( C )

15. What is the purpose of the volatile keyword in C?

16 / 20

Category: (Java)

16. Which method must be implemented when implementing the Runnable interface?

17 / 20

Category: (Java)

17. Which Java feature allows lambdas and streams?

18 / 20

Category: ( C )

18. Which function is used to allocate memory in C?

19 / 20

Category: ( C )

19. What does the malloc function return if memory allocation fails?

20 / 20

Category: ( C )

20. What is the output of this code?

#include

int main() {

int a[5] = {1, 2, 3, 4, 5};

printf("%d", *(a + 3));

return 0;

}

Scroll to Top