Write a program to print all the prime numbers with in the
given range
Answer Posted / don
#include<stdio.h>
#include<conio.h>
main()
{
int i, p, q;
int count;
printf("Enter lower Limit: ");
scanf("%d",&p);
printf("Enter Upper Limit: ");
scanf("%d",&q);
i=p;
while(i<=q)
{
for(count=2; count<i; count++)
{
if(i%count == 0)
goto line;
else
continue;
}
printf("%d ",i);
line: i++;
}
getch();
}
Is This Answer Correct ? | 6 Yes | 4 No |
Post New Answer View All Answers
How will you find a duplicate number in a array without negating the nos ?
What is a protocol in c?
How can you draw circles in C?
Explain two-dimensional array.
console I/O functions means a) the I/O operations done on disk b) the I/O operations done in all parts c) the input given through keyboard is displayed VDU screen d) none of the above
What is "Duff's Device"?
why return type of main is not necessary in linux
while initialization of array why we use a[][2] why not a[2][]...?
What is a void pointer? When is a void pointer used?
What is action and transformation in spark?
in linking some of os executables are linking name some of them
Tell me the use of bit field in c language?
When should volatile modifier be used?
c program for searching a student details among 10 student details
What does typeof return in c?