Discussion
Consider the array definition
int num [10] = {3, 3, 3};
Pick the Correct answers
Answer: A
Correct answer: num [9] is the last element of the array num
The array has 10 cells, so the last is num[9]. The initialiser supplies only three values, and when an array is partly initialised the remaining elements are set to zero. So num[0], num[1] and num[2] are 3, while num[3] and num[8] are both 0 - which is why the other two statements are false.
No comment is present. Be the first to comment.
Loading…
Post your comment
Please log in or register to post a comment.
Examination Categories
- SSC Exams
- Banking Exams
- Teaching Exams
- Civil Services Exams
- Railways Exams
- Engineering Recruitment Exams
- Defence Exams
- State Government Exams
- Police Exams
- Insurance Exams
- Nursing Exams
- Other Government Exams
- NRA CET
- PG Entrance Exams
- Campus Placement
- MBA Entrance Exams
- CUET and UG Entrance
- Judiciary Exams
- Regulatory Body Exams
- Software Development