C++ Programming and Technical Programming Technical

Which one of the following is the correct option showing the declaration(s) of a pointer to constant integer?

[1] const int* a;
[2] int* const a;
[3] int const* a;
[4] 1 and 3 both
[5] 1 and 2 both
[6] 2 and 3 both
[7] None of the above

Read Solution (Total 8)

C++ Other Question

Pankaj makes a program to print the product of cubes of the first 10 whole numbers.

She writes the following program:

integer x = 0 // statement 1

integer x = 0 // statement 1

integer sum = 0 // statement 2

while ( x < 10 ) // statement 3

{

sum = x*x*x // statement 4


x = x + 1 // statement 5

}

print sum // statement 6


Is her program correct? If not, which statement will you modify to correct it?

a. No error, the program is correct

b. Statement 1

c. Statement 4

d. statement 6
Which one of the following is true about the static keyword :-
[1] variable declared as static is shared by all
the objects of the class.
[2] variable declared as static is not shared
by all the objects of the class.
[3] It can't be used as data member of class.
[4] None
.