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
Do you know null pointer?
Is c language still used?
What is new line escape sequence?
How can I determine whether a machines byte order is big-endian or little-endian?
What is the difference between array and structure in c?
Are there any problems with performing mathematical operations on different variable types?
Where are local variables stored in c?
What is #include stdio h and #include conio h?
How are portions of a program disabled in demo versions?
Why flag is used in c?
Why is C language being considered a middle level language?
how could explain about job profile
What are the advantages of the functions?
What is structure data type in c?
What is huge pointer in c?