Thank you for you help...
this code is like a code i have ...
public int sumDigits(int n)
{
int rmd;
while(n!=0)
{ rmd = n%10;
n = n/10;
sum = sum+rmd;
}
}
return sum;
but isn't there a way to use a for loop insted ..
this is my code but i'm not sure of it ..
import java.io.*;
import java.lang.*;
public class Palindromes
{
public static void main(
String[]args)throws IOException
{
String reverse;
System.out.print("please Enter a number: ");
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
String s = reader.readLine();
int input = Integer.parseInt(s);
public int sumDigits(int n)
{
int rmd;
while(n!=0)
{ rmd = n%10;
n = n/10;
sum = sum+rmd;
}
}
return sum;
}
}
[ March 12, 2003: Message edited by: muath khalil ]