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
Write a program of prime number using recursion.
What is typedef struct in c?
How can I delete a file?
What is the difference between volatile and const volatile?
Is sizeof a keyword in c?
What is the use of sizeof () in c?
What is null pointer in c?
write a program which the o/p should b in such a way that s triangle if I/p is 3,a Square/rectangle if I/P=4,a pentagon if I/P=5 and so on...forget about the I/P which is less than 3
What are different types of variables in c?
How can I implement a delay, or time a users response, with sub-second resolution?
ATM machine and railway reservation class/object diagram
Explain how does flowchart help in writing a program?
Why c is procedure oriented?
Does c have class?
How can I find out how much free space is available on disk?