A variable that is declared private Is visible only m the su
Solution
2) All of the above is the correct option:
As by defintion Pointer is a variable which hold direct/physical memory location of another variable (this definition itself makes the first and second option true) and by definition Reference are constants which holds the memory location. Also when we pass by value that means a copy in memory of actual parameter\'s value that is passed in.
3) sum_of_double is the option
By definition a valid identifier could be following:
A valid identifier can have letters (both uppercase and lowercase letters), digits and it can start with underscore or letter.
5) arr = [0,5,10,15,20,25,30]
int x, *ptr1=arr+2, *ptr2 = &arr[5];
x=*(ptr2-2) + *(ptr1+3);
cout<<x;
Here *ptr1 = arr+2 which means we are setting ptr1 as pointer to the array index 2 i.e to element at index location arr[2] and *ptr2 = &arr[5] points to the arr[5] element.
x = *(ptr2-2) + *(ptr1+3)
ptr2 was refering to 5th index we are refering it as base location so we are just two index back hence basicaly we are refering to value at arr[3] which is 15 and ptr1+3 where prt1 was point to second index hence this equation points to 5th index value which is 25
x= 15+25
x= 40
Output is 40

