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

shiny_18

Honorable
Jan 14, 2013
4
0
10,510
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....
 
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.
 
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!
 

TRENDING THREADS