Which of the following is a valid c++ array definition


Asked by admin @ in Computers and Technology viewed by 345 People


Which of the following is a valid C++ array definition?

A.
int array[0];
B.
float $payments[10];
C.
void numbers[5];
D.
int array[10];

Answered by admin @



Answer:

The correct answer for the given question is option(D) i.e int array[10];

Explanation:

As array is the collection of similar types of elements

we can declared array

Datatype arrayname[size];

In option(A) the size of array is 0 which is wrong thats why this option is wrong.

In option(B) the arrayname cannot start with ' $'  thats why this option is wrong.

In option(c)  we cannot give void datatype as a arrayname thats why this option is wrong.

So the correct option is(D) i.e int array[10];


Similar Questions

Which of the following provides the best definition of consciousness

Asked by admin @ in English viewed by 361 persons

Which of the following is the best definition for stream of consciousness? a narrator who makes the reader think of him or her as undependable or untrusting by saying things …

Which of the following best matches the definition of psychology

Asked by admin @ in Social Studies viewed by 388 persons

. Which of the following is the best definition of the science of psychology? a. study of supernatural phenomena b. sociological study of individual and group dynamics c. scientific study …

Which of the following has a definite length

Asked by admin @ in Math viewed by 324 persons

Which of the following has definite length? a. lineb. line segmentc. rayd. none of these ​

Which of the following are tokens in c

Asked by admin @ in Computer Science viewed by 334 persons

Identify which of the following are the C token(s) a) Keyword b) Constants c) operators d) All Of these

Which of the following is valid website address

Asked by admin @ in English viewed by 433 persons

Which of the following is valid Website address? www.google.com ww#.c4learn.com [email protected] www.google

Give a definition for each of the following terms

Asked by admin @ in Math viewed by 317 persons

"Question 2 Give a definition for each of the following terms. Are there other terms that need to be defined first? What are they, and how might you define them? …

Which of the following is valid at absolute zero

Asked by admin @ in Math viewed by 347 persons

Which of the following is valid at absolute zero ? b) K.E. of the gas becomes zero and the molecular motion ala) K.E. of the gas becomes zero but …

Which of the following occupies more memory in c

Asked by admin @ in Computer Science viewed by 8147 persons

Which data type occupies most amount of memory in c?

Which of the following is an infrastructure definition tool

Asked by admin @ in Computer Science viewed by 443 persons

Which of the following is an infrastructure definition tool? A)Terraform B)templates C)playbook D)Ruby

Which of the following approach is adapted by c++

Asked by admin @ in Computer Science viewed by 337 persons

A) Which of the following approach is adapted by ‘C++?. i) Top-downii) Bottom-upiii) Right-leftiv) Left-right​

Which of the following is the best definition of speed

Asked by admin @ in Physics viewed by 298 persons

Which of the following best defines speed? It is an object's speed at a specific point in time. It is the distance traveled by an object in a specific direction. …

Which of the following is the best definition for allegory

Asked by admin @ in English viewed by 340 persons

Which of the following is the best definition for “allegory”?

Which of the following is not a keyword in c

Asked by admin @ in Computer Science viewed by 279 persons

Which of the following is not a keyword in C? a) const b) main c) size of d) void

Which of the following is the best definition of globalization

Asked by admin @ in Geography viewed by 286 persons

Which of the following is the best definition of globalization? A. the removal of political influence from world economies B. the drift of continents toward the geographic center of the …

Which of the following is a simple definition of oxidation

Asked by admin @ in Chemistry viewed by 297 persons

Which of the following is a simple definition of oxidation? the loss of electrons the gain of electrons an agent that oxidizes something an agent that reduces something

Most viewed questions in Computers And Technology


A customer wants to increase the storage capacity by 25gb

Asked by admin @ in Computers and Technology viewed by 4440 persons


A backup of sewage in the operation's storeroom is considered

Asked by admin @ in Computers and Technology viewed by 1003 persons




Solid yellow line bordering your lane of traffic marks a

Asked by admin @ in Computers and Technology viewed by 617 persons



Which of the following is not a windows utility program

Asked by admin @ in Computers and Technology viewed by 602 persons


When is a wrecker considered to be an emergency vehicle

Asked by admin @ in Computers and Technology viewed by 585 persons


Which operation on a pwc requires more than idle speed

Asked by admin @ in Computers and Technology viewed by 581 persons



Which of the following statements is true of a database

Asked by admin @ in Computers and Technology viewed by 570 persons


Which of the following is not true about an entrepreneur

Asked by admin @ in Computers and Technology viewed by 544 persons


Kitchen gadgets draw a context diagram for the order system

Asked by admin @ in Computers and Technology viewed by 523 persons