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
When should I declare a function?
Where are local variables stored in c?
Do character constants represent numerical values?
Write a program to print "hello world" without using a semicolon?
What does typeof return in c?
Write a program to print “hello world” without using semicolon?
c program to compute AREA under integral
I came across some code that puts a (void) cast before each call to printf. Why?
How to write a program for machine which is connected with server for that server automatically wants to catch the time for user of that machine?
What is the difference between break and continue?
Write a program to implement a round robin scheduler and calculate the average waiting time.Arrival time, burst time, time quantum, and no. of processes should be the inputs.
What is the newline escape sequence?
Which function in C can be used to append a string to another string?
What are the different data types in C?
What is the significance of scope resolution operator?