Podcast
Questions and Answers
What is the main characteristic of an array?
What is the main characteristic of an array?
When should an array be declared?
When should an array be declared?
What information does specifying the size of an array during declaration provide to the compiler?
What information does specifying the size of an array during declaration provide to the compiler?
What is the syntax for declaring an array with 'n' data items?
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?
How are arrays initialized at compile time?
Signup and view all the answers
Which statement describes array initialization without size?
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?
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:
'0 to (n-1)' represents the range of an array because:
Signup and view all the answers
'Partial array initialization' means:
'Partial array initialization' means:
Signup and view all the answers
'String initialization' is a special kind of array initialization where:
'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?
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?
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'};'?
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?
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?
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);'?
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?
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?
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?
'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