//Program to check prime no's  ranging from 2 to given number
for(int i = 2; i <= n; i++)
{
*if(i%2 == 0)
*{
printf("%d", is a prime number\n");
counter=counter +1;

}
if(counter=2)
printf("It is prime no");

On Thu, Jan 22, 2009 at 12:46 AM, Glenn <[email protected]> wrote:

> First of all, find the bugs in your code.  Actually, I'll give partial
> credit if you can find just one of them.
>
> Secondly, explain to me how this is suppose to determine if the number (i)
> is prime.
>
> ...Glenn
>
> On Wed, Jan 21, 2009 at 2:31 AM, Anil Kumar <[email protected]> wrote:
>
>> int counter=0;
>> for(int i = 1; i <= n; i++)
>> {
>> if(n%2 == 0)
>> {
>> printf("%d", is a prime number\n");
>> counter=counter +1;
>> }
>> if(counter=2)
>> printf("It is prime no");
>>
>
>

Reply via email to