Questions and Answers
What is the main characteristic of an array?
All elements are of the same data type
When should an array be declared?
Before it is used in the program
What information does specifying the size of an array during declaration provide to the compiler?
Number of elements in the array
What is the syntax for declaring an array with 'n' data items?
Signup and view all the answers
How are arrays initialized at compile time?
Signup and view all the answers
Which statement describes array initialization without size?
Signup and view all the answers
In which way can array elements be initialized with int, char, etc., during declaration?
Signup and view all the answers
'0 to (n-1)' represents the range of an array because:
Signup and view all the answers
'Partial array initialization' means:
Signup and view all the answers
'String initialization' is a special kind of array initialization where:
Signup and view all the answers
Which of the following array initialization statements would result in a compilation error?
Signup and view all the answers
What happens when a partial array initialization is done in C language?
Signup and view all the answers
What is the size of the array 'b' in the statement 'char b[]={'C','O','M','P','U','T','E','R'};'?
Signup and view all the answers
How is an array initialized when a string is used in C language?
Signup and view all the answers
What does the 'scanf' function do in array initialization?
Signup and view all the answers
What would be the result of initializing an integer array 'x' using 'scanf("%d %d%d",&x,&x,&x);'?
Signup and view all the answers
In C language, what happens if no size is specified during array initialization?
Signup and view all the answers
If an array declaration does not specify size but provides initial values, what determines the size of the array?
Signup and view all the answers
'char b="COMPUTER";' would cause a compilation error. What is the correct way to initialize this character variable with the string?
Signup and view all the answers