Use the sales array to answer. The array was declared using the int sales[5] = {10000, 12000,
Question:
Use the sales array to answer. The array was declared using the int sales[5] = {10000, 12000, 900, 500, 20000}; statement.
Which of the following if clauses verifies that the array subscript stored in the x variable is valid for the sales array?
a. if (sales[x] >= 0 && sales[x] < 4)
b. if (sales[x] >= 0 && sales[x] <= 4)
c. if (x >= 0 && x < 4)
d. if (x >= 0 && x <= 4)
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Related Book For
Microsoft Visual C# An Introduction to Object-Oriented Programming
ISBN: 978-1337102100
7th edition
Authors: Joyce Farrell
Question Posted: