Question: Assume the following declarations are made and indicate which items below are valid subscripted variables. int a[] = new int[10]; char b[] = new char[6];

Assume the following declarations are made and indicate which items below are valid subscripted variables.
int a[] = new int[10];
char b[] = new char[6];
int x = 7, y = 2;
double z = 0.0;
a. a[0]
b. b[0]
c. c[1.0]
d. b['a']
e. b[a]
f. a[x + y]
g. a[x % y]
h. a[10]
i. c[-1]
j. a[a[4]]

Step by Step Solution

3.45 Rating (164 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

a Valid b Valid c ... View full answer

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

Document Format (1 attachment)

Word file Icon

1013-C-S-O-S (793).docx

120 KBs Word File

Students Have Also Explored These Related Operating System Questions!