Write a program to print all the prime numbers with in the
given range
Answer Posted / om
void find_primenumber_in_range(int r1,int r2)
{
int i,j;
for(i=r1;i<=r2;i++)
{
for(j=2; j<=(i/2); j++)
if(i%j==0)
break;
if(j== (i/2 +1))
printf("%d\t",i);
}
}
| Is This Answer Correct ? | 31 Yes | 21 No |
Post New Answer View All Answers
Calculate 1*2*3*____*n using recursive function??
How can I split up a string into whitespace-separated fields?
How can you increase the size of a statically allocated array?
What is a sequential access file?
Can we use visual studio for c?
In a byte, what is the maximum decimal number that you can accommodate?
how to find binary of number?
Explain what is the difference between null and nul?
What is cohesion and coupling in c?
What are the 5 data types?
What will the code below print when it is executed? int x = 3, y = 4; if (x = 4) y = 5; else y = 2; printf ("x=%d, y=%d ",x,y);
What is the function of volatile in c language?
why use "return" statement a) on executing the return statement it immediately transfers the control back to the calling program b) it returns the value present in the parentheses return, to the calling program c) a & b d) none of the above
How do you define CONSTANT in C?
Do you know what are bitwise shift operators in c programming?