Use the following int array int [ ] numbers = { 42, 28, 36, 72, 17, 25, 81, 65, 23, 58 } -Open file data.txt to write. -
Posted: Fri Jul 01, 2022 5:39 am
Use the following int array
int [ ] numbers = { 42, 28, 36, 72,17, 25, 81, 65, 23, 58 }
-Open file data.txt to write.
-then provide the code to write thevalues of the array numbers to the file with the
following format. You must accessthe elements of the array numbers to get the values
-Remember to close the file
Numbers at index 0 = 42
Numbers at index 1 = 28
Numbers at index 2 = 36
Numbers at index 3 = 72
Numbers at index 4 = 17
Numbers at index 5 = 25
Numbers at index 6 = 81
Numbers at index 7 = 65
Numbers at index 8 = 23
Numbers at index 9 = 58
int [ ] numbers = { 42, 28, 36, 72,17, 25, 81, 65, 23, 58 }
-Open file data.txt to write.
-then provide the code to write thevalues of the array numbers to the file with the
following format. You must accessthe elements of the array numbers to get the values
-Remember to close the file
Numbers at index 0 = 42
Numbers at index 1 = 28
Numbers at index 2 = 36
Numbers at index 3 = 72
Numbers at index 4 = 17
Numbers at index 5 = 25
Numbers at index 6 = 81
Numbers at index 7 = 65
Numbers at index 8 = 23
Numbers at index 9 = 58