Question: Suppose that gamma is an array of 5 0 elements of type int and j is an int variable. Which of the following for loops

Suppose that gamma is an array of 50 elements of type int and j is an int variable. Which of the following for loops sets the subscript of gamma out-of-range?
a.
for (j =0; j <=49; j++)
cout << gamma[j]<<"";
b.
for (j =1; j <50; j++)
cout << gamma[j]<<"";
c.
for (j =0; j <=50; j++)
cout << gamma[j]<<"";
d.
for (j =0; j <=48; j++)
cout << gamma[j]<<"";

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!