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


Asked by admin @ in Computers and Technology viewed by 334 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 351 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 381 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 316 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 327 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 423 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 307 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 337 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 8127 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 435 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 329 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 291 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 331 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 270 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 279 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 292 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 4429 persons




Solid yellow line bordering your lane of traffic marks a

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



Which of the following is not a windows utility program

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


When is a wrecker considered to be an emergency vehicle

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


Which operation on a pwc requires more than idle speed

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



Which of the following statements is true of a database

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


Which of the following is not true about an entrepreneur

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


Kitchen gadgets draw a context diagram for the order system

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