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

What are multibyte characters?

647


What are valid signatures for the Main function?

703


What is the use of a semicolon (;) at the end of every program statement?

780


Apart from dennis ritchie who the other person who contributed in design of c language.

817


What are the advantages of using macro in c language?

596






What is the use of bitwise operator?

694


Explain how do you view the path?

661


What are the string functions? List some string functions available in c.

609


What is c language used for?

563


Can a file other than a .h file be included with #include?

688


What is the meaning of 2d in c?

617


What is the difference between break and continue?

608


Is c procedural or functional?

592


What is the behavioral difference when include header file in double quotes (“”) and angular braces (<>)?

815


can any one tel me wt is the question pattern for NIC exam

1560