Write a program to print all the prime numbers with in the
given range

Answer Posted / chavidi

void prime(int a,int b)
{
int i,j,c
for(i=a;i<=b;i++)
{
c=0;
for(j=1;j<=a;j++)
{
if(a%j==0)
{
c++;
}
}
if(c==2)
printf(i);
}
}

Is This Answer Correct ?    8 Yes 14 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Tell me when would you use a pointer to a function?

594


Why is it that not all header files are declared in every C program?

667


What do header files do?

593


What is scanf_s in c?

621


What is context in c?

528






What extern c means?

525


When do we get logical errors?

625


In C language, the variables NAME, name, and Name are all the same. TRUE or FALSE?

760


What does c mean in basketball?

552


What is a wrapper function in c?

571


how is the examination pattern?

1585


What is difference between array and structure in c?

565


What is the right type to use for boolean values in c?

571


What is difference between arrays and pointers?

573


The % symbol has a special use in a printf statement. Explain how would you place this character as part of the output on the screen?

649