Size of the array need not be specified, when
A. Initialization is a part of definition
B. It is a declaratrion
C. It is a formal parameter
D. All of these
Answer: Option A
Solution (By Examveda Team)
In C programming, the size of the array does not need to be specified when initialization is a part of definition.Initialization during Definition:
When an array is defined and initialized at the same time, the size of the array can be omitted. The size is automatically determined by the number of elements provided in the initialization. For example:
int arr[] = {1, 2, 3, 4, 5}; // Size is determined by the number of elements
Declaration:
When declaring an array without initializing it, the size must be specified if the array is not initialized. For example:
int arr[5]; // Size must be specified
Formal Parameter:
In function prototypes or definitions where an array is used as a formal parameter, the size does not need to be specified. For example:
void function(int arr[]); // Size not required
All of These:
This option is incorrect because the size must be specified in cases other than initialization during definition.
Therefore, the correct answer is Option A: Initialization is a part of definition.
Join The Discussion
Comments (4)
Related Questions on Arrays and Strings

it is not allowed to declare array without size i checked it also, then its all of the above is correct
What is size of () in C?*
What is the value of x in this C code? *
I guess the the answer is a