+ 23

I need help with this exercise : Print the elements of array in reverse order

TASK : Given an array, of  'n' integers. Print the elements of array in reverse order as a single line of space-separated numbers. NOTE : The first line contains an integer,  'n'  (the size of our array).  The second line contains  'n'  space-separated integers describing array's elements.

21st Jan 2018, 11:08 AM
Danijel Ivanović
Danijel Ivanović - avatar
27 Answers
+ 2
Here is my try Update [bug fixed] https://code.sololearn.com/WruPfH33OdNU
21st Jan 2018, 2:39 PM
StoneCoder🇬🇦
StoneCoder🇬🇦 - avatar
+ 17
I will try to do ths exercise in Java. 😊 I started to learn C# and I'm trying to do a task in it, but it's not good !! 🙃
21st Jan 2018, 12:31 PM
Danijel Ivanović
Danijel Ivanović - avatar
+ 17
It's not completely clear to me in the task set ?! 🤔 That's why I set it up to try and find a solution, 😉 and surely Java is more interesting, 😊 at least to me always !! 👍😆
21st Jan 2018, 1:03 PM
Danijel Ivanović
Danijel Ivanović - avatar
+ 17
Input Format : The first line contains an integer,  N => (the size of array), 1 < N < 1000 The second line contains N space-separated integers describing array A's elements. Input : 4 == N Size of array => first line, ENTER, 1 4 3 2 == array elements, SUBMIT
21st Jan 2018, 1:13 PM
Danijel Ivanović
Danijel Ivanović - avatar
21st Jan 2018, 2:30 PM
Danijel Ivanović
Danijel Ivanović - avatar
+ 16
https://code.sololearn.com/cVMeqhA96ePy/?ref=app
21st Jan 2018, 3:33 PM
Danijel Ivanović
Danijel Ivanović - avatar
+ 16
It's not like in the task, but I'll make it better !! 😆 https://code.sololearn.com/Wz8wDtWQxwCU/?ref=app
22nd Jan 2018, 10:35 AM
Danijel Ivanović
Danijel Ivanović - avatar
+ 15
https://code.sololearn.com/WAlTS1o3B7Q7/?ref=app
22nd Jan 2018, 10:43 AM
Danijel Ivanović
Danijel Ivanović - avatar
+ 15
@John Dooe If you have any suggestions for these codes, please write to me, thank you. 😊😆
22nd Jan 2018, 10:46 AM
Danijel Ivanović
Danijel Ivanović - avatar
+ 14
Now Your answer will be The Best !! 😆
21st Jan 2018, 2:50 PM
Danijel Ivanović
Danijel Ivanović - avatar
+ 14
I'll try to do a solution with the method, but again in Java !! 😎
21st Jan 2018, 2:50 PM
Danijel Ivanović
Danijel Ivanović - avatar
+ 13
@Bihan Samarasinghe Just : Tap Here To Load More https://code.sololearn.com/cyOSi9OosU2X/?ref=app
23rd Jan 2018, 11:51 AM
Danijel Ivanović
Danijel Ivanović - avatar
1st May 2018, 11:35 PM
Uni
Uni - avatar
+ 3
Will use reverse() with JavaScript but then the output will be 1,2 instead of 1 2 which is expected, I think there is also reverse() available for Java check it out. To avoid the comma you shouldn't output the final result as an array I think!
21st Jan 2018, 12:21 PM
StoneCoder🇬🇦
StoneCoder🇬🇦 - avatar
+ 3
😊@Danijel Ivanović thanks man!!✌🏾️😎 😀😀
21st Jan 2018, 6:31 PM
StoneCoder🇬🇦
StoneCoder🇬🇦 - avatar
23rd Jan 2018, 5:31 AM
John M Mutuma
John M Mutuma - avatar
+ 3
@dim_kno Thanks but using in instead of make thing worse, I had already declared var i that why didn't include it in the for loop, The problem come from the calculation for sure!
23rd Jan 2018, 8:59 AM
StoneCoder🇬🇦
StoneCoder🇬🇦 - avatar
+ 3
@dim_knp maybe, but I'm iFan😊😀 The problem is with the app I think it too buggy on iOS, The crash when answering some drag and drop question On question in the learning section. I've tested the app on android it way better. I broke that android phone 2 days ago😔, hope to fix it next week😊
23rd Jan 2018, 9:29 AM
StoneCoder🇬🇦
StoneCoder🇬🇦 - avatar
+ 3
@dim_knp ont really going back I never been there that device purpose is meanly to test android apps once I start writing Java apps, I stop learning Java to concentrate on web dev for now
23rd Jan 2018, 9:46 AM
StoneCoder🇬🇦
StoneCoder🇬🇦 - avatar
+ 2
😊, when I took a peek a Java and C# I found them quite similar but Java was more interesting. Here use or modify this function it will do the trick. Will post a working code of it using js 😊. function reverseInput(str) { var reverse = " ", i=0; for (if of str) { reverse = i + reverse; } return reverse }
21st Jan 2018, 12:48 PM
StoneCoder🇬🇦
StoneCoder🇬🇦 - avatar