Link to home
Start Free TrialLog in
Avatar of Fred_45559
Fred_45559

asked on

Print all five-digit Palindrome numbers

I just wrote this program:   Can someone give me some input on how to make the numbers print side by side?

Example 10001, 10010,............


Here is the program I wrote?


class Week6prob1dem
{
    public static void main(String[] args)
    {
        for (int i = 100; i<=999; i++)
            System.out.println((i/100)+""+((i/10)%10)+""+(i%10)+""+((i/10)%10)+""+(i/100));
           
    }
   
}

ASKER CERTIFIED SOLUTION
Avatar of marchent
marchent
Flag of Bangladesh image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Fred_45559
Fred_45559

ASKER

marchent,

I tried this code;

class Tester49
{
    public static void main(String[] args)
    {
        for (int i = 100; i<=999; i++)
         >>System.out.println((i/100)+""+((i/10)%10)+""+(i%10)+""+((i/10)%10)+""+(i/100));
System.out.print((i/100)+""+((i/10)%10)+""+(i%10)+""+((i/10)%10)+""+(i/100)+",");

          }
    }

compiled:  ______________________________________

illegal start of expression              on line 6



I tried putting quotation marksi in the brackets.  I've research it and have not found anything.    I tried print() first then println.  and it still did not work?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial

ooppss sorry the solution had already been posted
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of hoomanv
hoomanv
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
if you want to comment the particular line u want to use // instead of >>