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


Please Help Members By Posting Answers For Below Questions

What is the difference between scanf and fscanf?

664


Explain what are the advantages and disadvantages of a heap?

597


Difference between goto, long jmp() and setjmp()?

708


Why does the call char scanf work?

620


What is pass by value in c?

597






design and implement a data structure and performs the following operation with the help of file (included 1000 student marks in 5 sub. and %also) 1.how many students are fail in all 5 subjects (if >35) 2. delete all student data those are fail in all 5 subjects. 3. update the grace marks (5 no. if exam paper is 100 marks) 4. arrange the student data in ascending order basis of marks. 5.insert double of deleted students with marks in the list.

1497


write a c program to find the sum of five entered numbers using an array named number

1617


What could possibly be the problem if a valid function name such as tolower() is being reported by the C compiler as undefined?

746


Differentiate between a structure and a union.

767


A text file that contains declarations used by a group of functions,programs,or users a) executable file b) header file c) obj file d) .cfile

646


Can we assign integer value to char in c?

617


Is there anything like an ifdef for typedefs?

702


What is s in c?

618


What are the restrictions of a modulus operator?

638


What is new line escape sequence?

810