page-banner
Computer Basic
Q 1. What will be the output of the following Python code?<br><br><pre><code>arr = [12, 5, 2] product = 1 for num in arr: product *= num print(product)</code></pre>

A. 12

B. 120

C. 19

D. Error

Q 2. Which of the following is the correct way to define a pointer in C++?

A. int *ptr;

B. int ptr*;

C. pointer int *;

D. ptr int*;

Q 3. What does the 'new' operator do in C++?

A. Allocates memory for variables

B. Deallocates memory

C. Allocates memory dynamically for objects

D. Returns a reference to an object

Q 4. Which of the following will result in a compilation error in C++?

A. int x = 10;

B. int x = 'A';

C. int x = 10.5;

D. int x = 10.0;

Q 5. Which of the following is the correct syntax for declaring a constant in C++?

A. const int a = 10;

B. int const a = 10;

C. constant int a = 10;

D. both A and B