Please explain the following questions!

Q3 (why not option C in 3rd ques?)
How can dynamic array of pointers(to integers) of size 100 can be
created using new in C++?
A) int *arr = new int *[100];
B) int **arr = new int *[100];
C) int *arr = new int [100];
D) int arr = new int [100];

Q7
In the piece of code, arr[ ][ ] is a 2D
array and assume that the
contents of the 2D
array are already filled up. What is stored in the
variable sum at the end of the code segment?
int arr[3][3];
int i, sum=0; i = 0; while(i<3) {
sum += * ( * (arr+i)+(i++)); }
printf(“sum:%d”, sum);
A) Sum of all elements in the matrix
B) Sum of alternate elements in the matrix
C) Sum of the elements along the principal diagonal
D) None
Q8
Would the following program compile?
#include
using namespace std;
int main() {
int a=10, *j; void *k; j=k=&a; j++;
k++; cout<<j<<k; return 0;
}
Would the following program compile?
A) Yes
B) No

we have to create array of pointers
not array of integers
int *arr = new int [n] (used to create array of integers)
int**arr = new int* [n] (used to create array of pointers pointing to int)

NO
because to print void pointer we first have to typecaste it into int*
also ++ is not valid on void pointers
also to store &a into k we have to first typecast this into void*

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.