+ 7
Challenge :- Write a program to input odd no.(n) of no.s i.e , n is odd and print it in to & fro form
You 1st need to sort the elements and then it in to & fro form, like pendulum moves. Eg: Enter the no. of elements you want to enter - 7 Input - 65,76,14,54,89,91,27 Output:- Sorted order - 14,27,54,65,76,89,91 To & fro form - 14 54 76 91 89 65 27 Here the elements are printed at the point where the bob of pendulum is momentarily at rest. If the no. of inputs are even ,"print invalid input".
2 Answers
+ 11
My Try In C++ :
https://code.sololearn.com/clawqEN9EnIg/#cpp