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
plz let me know how to become a telecom protocol tester. thank you.
What is a global variable in c?
What is a macro in c preprocessor?
When a c file is executed there are many files that are automatically opened what are they files?
How does struct work in c?
Why c is called a middle level language?
What is the use of a ‘ ’ character?
Give a one-line C expression to test whether a number is a power of 2. [No loops allowed - it's a simple test.]
How can you determine the maximum value that a numeric variable can hold?
What is meant by realloc()?
What are the differences between Structures and Arrays?
What is scanf_s in c?
Write a function expand(s1,s2) that expands shorthand notations like a-z in the string s1 into the equivalent complete list abc...xyz in s2 . Allow for letters of either case and digits, and be prepared to handle cases like a-b-c and a-z0-9 and -a-z. z-a:zyx......ba -1-6-:-123456- 1-9-1:123456789987654321 a-R-L:a-R...L a-b-c:abbc
What is the deal on sprintf_s return value?
In a header file whether functions are declared or defined?