Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
Prime Number problem in java
Name: ran Date: June 28, 2005 at 18:11:19 Pacific OS: d CPU/Ram: 128mb ram
Comment:
i have a problem using java to create a program to determine if it is a prime or not. And also a palindrome code. Can you help me with this?
Yes, but only if you try it yourself first so we aren't just doing your homework for you. You should do what you can yourself and post a specific problem if you get stuck.
-SN
0
Response Number 2
Name: Ishwar Dhanuka Date: July 12, 2005 at 23:16:40 Pacific
Reply:
class palindrome { public static void main(String[] args) { int rem=0,rev=0,n=1561,a=n; do { rem=a%10; rev=rem+(10*rev); a/=10; } while(a!=0); if(rev==n) System.out.println("Yes"); else System.out.println("No"); } }
Summary: Hi, I have written a game in Java in which the player can move a character using WASD. The problem I am having is that every now and then one of they keys will 'stick'. whenever a keypressed event o...
Summary: Hello, I'm trying to write a program in JAVA, to calculate the number of integer values entered as a string by the user and work out the average of numbers. The final output should display the numbers...
Summary: Ya, you're probably not resetting the number each time they want to play. Also, how is the random number seeded? (Never used the random number function in java, so the user id est you might not be abl...