this project is to determine if a phone number is a prime number. if the number is a prime number then print a message to the effect. if the number is not a prime number then print the prime factors of the number. allow the user to continue entering numbers for as long as he or she wishes.

i was given the following, but its not quite right and perhaps not quite complete:

for(count = 5; count <3; count = count +2)
{
x=0;
sq = Math.sqrt(count)
prime = true;
while(a[x]<sq,&&prime)
{
if(count % a(x) ==0)
prime = false;
else
x++;
}
if(prime)
a[index] = count;
index++;
}

there should be an automatic ban for not using code tags.

Who gave you that ?!
Better star over

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.