Welcome! Log In Create A New Profile

Advanced

Assignment 1 - Question 1

Posted by robbiepapenfus 
Announcements Last Post
Announcement SoC Curricula 09/30/2017 01:08PM
Announcement Demarcation or scoping of examinations and assessment 02/13/2017 07:59AM
Announcement School of Computing Short Learning Programmes 11/24/2014 08:37AM
Announcement Unisa contact information 07/28/2011 01:28PM
Assignment 1 - Question 1
May 02, 2008 01:13PM
Hi guys,

I have the following in a loop:

System.out.println(Number % 10);

The problem is when i pass my class an number e.g. 1234, it reverses the order of the numbers, but they are dispayed on a new line:

4
3
2
1

Is there any other ways I can print out a line in java WITHOUT putting it on a new line?

Your help would be greatly appreciated.

Kind regards,
Robbie
avatar Re: Assignment 1 - Question 1
May 02, 2008 03:19PM
The System.out.println(Number % 10); prints the info and a newline!

You must use the System.out.print() command, without the "ln" part.

Hope this helps?
Re: Assignment 1 - Question 1
May 03, 2008 11:26AM
Thanks CountZero, much appreciated!
Sorry, only registered users may post in this forum.

Click here to login