0

How to reverse a number using array?

11th Oct 2016, 5:12 PM
Raj shah
Raj shah - avatar
2 Answers
0
1) full fill the array with the number 2) Do a for loop with array length half 3) in the for loop change the first with last digit, second with the one before the last digit ... hint: change i with arraylength-i i++; change i with arraylength-i i++; .... build this in a for loop and you are done
12th Oct 2016, 8:37 AM
DynoosHD
DynoosHD - avatar
0
fill array with each number and use reverse() method of array object which gives u a reversed array as output
7th Nov 2016, 5:40 PM
Harish Sune
Harish Sune - avatar