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
typedef struct{ char *; nodeptr next; } * nodeptr ; What does nodeptr stand for?
Explain indirection?
Explain what is the most efficient way to store flag values?
What are nested functions in c?
Explain what is the general form of a c program?
How do you use a 'Local Block'?
how to create duplicate link list using C???
What are the different types of control structures?
Explain how to reverse singly link list.
What are structural members?
How many bytes is a struct in c?
What is 'bus error'?
How would you obtain the current time and difference between two times?
How can I dynamically allocate arrays?
main use of recursive function a) processing speed high b) reduce program length/reduce repeated statements c) if you do not, use iterative methods like, for, while or do-while d) all the above