
Patrick B. answered 05/08/21
Math and computer tutor/teacher
No it is not a syntax error...
But you will get a run-time error, the program may crash, and you're hosed...
you just over-stepped the array bound
Artem H.
asked 05/07/21Will this result in syntax error?
for the same array as the above question,
int [] salaries = {20,95, 77,56, 83}
the statement
salaries[5]=100
This will result in what if not syntax error?
(((Given an array declaration of salaries in thousands of dollars,
int [] salaries = {20,95, 77,56, 83}
The a=index at which the salary 56 is found is)))
Patrick B. answered 05/08/21
Math and computer tutor/teacher
No it is not a syntax error...
But you will get a run-time error, the program may crash, and you're hosed...
you just over-stepped the array bound
Get a free answer to a quick problem.
Most questions answered within 4 hours.
Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.