Storing the user input without using any predefinedfunctions and reverse the sam

shiny_18

Honorable
Jan 14, 2013
4
0
10,510
0
In java can we store the user input and reverse the same without using any pre-defined functions.i.e when the user gives hello the output should be olleh but any built in fns like .length ,charAt(), etc are not allowed to use....
 

Ijack

Distinguished
Yes, you can. And I guess the purpose of this homework is for you to think about how you would do that.

But you will need to use some built-in functions to read the input and to print the output.
 

calmstateofmind

Distinguished
Jul 2, 2009
292
0
19,010
21
Get the user input, break it up into chars, store those in an array, get the number of cells in the array, print the array in reverse with a controlled loop that counts down the index of the array each time it prints a character. Tadaa!
 
Thread starter Similar threads Forum Replies Date
Madzskie75 Apps General Discussion 0
C Apps General Discussion 0
G Apps General Discussion 1
K Apps General Discussion 2
C Apps General Discussion 2
B Apps General Discussion 1
E Apps General Discussion 1
C Apps General Discussion 4
T Apps General Discussion 1
L Apps General Discussion 2
H Apps General Discussion 2
J Apps General Discussion 1
G Apps General Discussion 0
G Apps General Discussion 0
B Apps General Discussion 6
G Apps General Discussion 1
S Apps General Discussion 2
L Apps General Discussion 2
S Apps General Discussion 1
Satan-IR Apps General Discussion 1

ASK THE COMMUNITY