write the program for prime numbers?

Answer Posted / santhoshi

main()
{
for(int i=1;i<100;i++)
{
count=0;
for(j=1;j<=100;j++)
{
if(i%j==0)
{
count++;
}
}
if(count==2)
{
printf(i);
}
}
getch();
}

Is This Answer Correct ?    12 Yes 12 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain how can I prevent another program from modifying part of a file that I am modifying?

639


When reallocating memory if any other pointers point into the same piece of memory do you have to readjust these other pointers or do they get readjusted automatically?

809


If a variable is a pointer to a structure, then which operator is used to access data members of the structure through the pointer variable?

780


What is break statement?

631


How do you use a 'Local Block'?

723






What is static memory allocation?

606


What is 2c dna?

608


using for loop sum 2 number of any 4 digit number in c language

1734


Explain the term printf() and scanf() used in c language?

597


How do you convert a decimal number to its hexa-decimal equivalent.Give a C code to do the same

649


What is the difference between test design and test case design?

1570


When do we get logical errors?

637


What are the advantages of using Unions?

642


Linked list is a Linear or non linear explain if linear how it working as a non linear data structures

1764


What is stack in c?

615