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
What is table lookup in c?
Explain c preprocessor?
How can I delete a file?
What is a program?
How can I manipulate individual bits?
What are the advantages of using Unions?
Can the “if” function be used in comparing strings?
What is wrong with this statement? Myname = 'robin';
typedef struct{ char *; nodeptr next; } * nodeptr ; What does nodeptr stand for?
What is function pointer c?
What are runtime error?
What is c language & why it is used?
Can you please explain the difference between malloc() and calloc() function?
Do you know the use of 'auto' keyword?
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