If you're having problems with a do loop, you need to post up code that includes the do loop. ;)
Using CODE TAGS! Putting your code right between code tags, lets your code stay looking like code, and not like a dog's breakfast.
Adak
Nearly a Posting Virtuoso
1,479 posts since Jun 2008
Reputation Points: 425
Solved Threads: 185
Indentation is pretty important too, especially when you have a problem with looping
#include<stdio.h>
int main()
{
int pcheck = 1,i;
int k = 1000
for(i = 2;i < k;i++)
{
if((k % i) == 0)
{
pcheck = 0;
break;
}
}
if(pcheck)
{
printf("%d is a prime .\n",k);
}
else
{
printf("%d is not a prime.\n",k);
}
return 0;
}
chrjs
Junior Poster in Training
96 posts since Feb 2011
Reputation Points: 58
Solved Threads: 19