Advertisements
Advertisements
प्रश्न
Given:
int a[ ] = new int [5];//declaration of array
a[3]=5;
The code will generate ______.
पर्याय
no error
logical error
syntax error
runtime error
MCQ
रिकाम्या जागा भरा
Advertisements
उत्तर
The code will generate no error.
Explanation:
Declaring an array of size 5 creates valid slots from indices 0 to 4. Assigning a value to a[3] is perfectly safe because index 3 falls completely within this legal range.
shaalaa.com
या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
पाठ 7: Arrays - One Dimension - Exercises [पृष्ठ १७२]
