0% 67 Year1st Year2nd Year3rd Year4th YearStateAndhra PradeshArunachal PradeshAssamBiharChhattisgarhGoaGujaratHaryanaHimachal PradeshJharkhandKarnatakaKeralaMadhya PradeshMaharashtraManipurMeghalayaMizoramNagalandOdishaPunjabRajasthanSikkimTamil NaduTelanganaTripuraUttar PradeshUttarakhandWest Bengal 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; } A) Undefined behavior B) 10 20 C) Compilation error D) 20 10 2 / 20 Category: ( C++ ) 2. What is the output of this program? #include void print() { std::cout << "Hello"; } int main() { print(); return 0; } A) Nothing is printed B) Compilation error C) Hello D) Undefined behavior 3 / 20 Category: ( C++ ) 3. What does mutable keyword do? A) Makes a class method const B) Allows modification of a member in a const object C) Declares a variable in a global scope D) Enables the use of const data members 4 / 20 Category: (Java) 4. Which of these classes is not synchronized? A) StringBuilder B) StringBuffer C) HashTable D) Vector 5 / 20 Category: ( C++ ) 5. Which of these is NOT a property of std::shared_ptr? A) Automatic deallocation B) Shared ownership of resources C) Ensures single-threaded access D) Reference counting 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? A) Overriding B) Encapsulation C) Abstract Class D) Interface 7 / 20 Category: ( C++ ) 7. What is the primary difference between delete and delete[]? A) delete[] automatically resizes arrays B) delete[] is faster C) delete[] is used for arrays, delete is for single objects D) delete deallocates memory, delete[] does not 8 / 20 Category: ( C ) 8. What does this code print? #include int main() { printf("%d", sizeof('A')); return 0; } A) 1 B) 4 C) 2 D) Undefined 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]); } } A) 2 B) 4 C) IndexOutOfBoundsException D) Compilation error 10 / 20 Category: ( C++ ) 10. What is the output of this code? int a = 5; int b = a++; std::cout << a << " " << b; A) 6 5 B) 5 6 C) 5 5 D) 6 6 11 / 20 Category: (Java) 11. Which of the following statements about HashMap is true? A) HashMap is synchronized. B) HashMap allows null keys and null values. C) The iteration order of HashMap is predictable. D) HashMap internally uses LinkedList for collision resolution. 12 / 20 Category: ( C++ ) 12. What is the output of this code? int x = 5; int &y = x; y = 10; std::cout << x; A) 10 B) 5 C) Undefined behavior D) Compilation error 13 / 20 Category: ( C ) 13. What is the value of the expression 5 && 0 || 3 && 4? A) 0 B) Undefined behavior C) 4 D) 1 14 / 20 Category: (Java) 14. In an ecommerce system, you want to hide sensitive user details like passwords. Which OOP principle helps achieve this? A) Polymorphism B) Encapsulation C) Inheritance D) Abstraction 15 / 20 Category: ( C ) 15. What is the purpose of the volatile keyword in C? A) To prevent compiler optimizations on a variable B) To allocate memory dynamically C) To declare variables that cannot be modified D) To declare a constant variable 16 / 20 Category: (Java) 16. Which method must be implemented when implementing the Runnable interface? A) execute() B) run() C) process() D) start() 17 / 20 Category: (Java) 17. Which Java feature allows lambdas and streams? A) Reflection B) Inheritance C) Generics D) Functional programming 18 / 20 Category: ( C ) 18. Which function is used to allocate memory in C? A) realloc B) All of the above C) free D) malloc 19 / 20 Category: ( C ) 19. What does the malloc function return if memory allocation fails? A) Undefined behavior B) NULL C) A segmentation fault D) A pointer to the allocated memory 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; } A) 5 B) 3 C) 2 D) 4 Your score is LinkedIn Facebook Twitter VKontakte 0%