Question: onsider the following code: int[] a = {65, 78, 92, 51, 18}; for (int i = 0; i < a.length; i++) { a[i] = a[i]

onsider the following code:

int[] a = {65, 78, 92, 51, 18};

for (int i = 0; i < a.length; i++)

{

a[i] = a[i] % 10;

}

for (int i = 0; i < a.length; i++)

{

System.out.print(a[i] + " ");

}

  • 6 7 9 5 1

    6 7 9 5 1

  • 67951

    67951

  • 5 8 2 1 8

    5 8 2 1 8

  • 58218

    58218

  • There is an error in the code, so this does not run

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!