public class iterativeString
{
	public static void writeBackward(String s, int size)
	{
		// Iterative version.
   		while (size > 0)
   		{
      		System.out.print(s.substring(size-1, size));	//changed to just print not println
      		--size;
   		}  // end while
	}  // end writeBackward

	public static void main(String[] args)
	{
			String str = "Hello world!";
			writeBackward(str, str.length());
			System.out.println();
	}

}