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 quick sort in c?
What is the difference between class and object in c?
What is the difference between int main and void main?
How many types of functions are there in c?
What are actual arguments?
write a program fibonacci series and palindrome program in c
What is int main () in c?
difference between object file and executable file
Is it possible to pass an entire structure to functions?
Is main a keyword in c?
In C programming, how do you insert quote characters (‘ and “) into the output screen?
What tq means in chat?
#define MAX(x,y) (x) >(y)?(x):(y) main() { inti=10,j=5,k=0; k= MAX(i++,++j); printf("%d..%d..%d",i,j,k); }
What is volatile variable how do you declare it?
If one class contains another class as a member, in what order are the two class constructors called a) Constructor for the member class is called first b) Constructor for the member class is called second c) Only one of the constructors is called d) all of the above