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 are directives in c?
Explain Basic concepts of C language?
What is clrscr ()?
When the macros gets expanded?
Does c have function or method?
What is the right type to use for boolean values in c? Is there a standard type?
Do you have any idea about the use of "auto" keyword?
can we change the default calling convention in c if yes than how.........?
What is the use of header?
Are there any problems with performing mathematical operations on different variable types?
How can I open files mentioned on the command line, and parse option flags?
How do you determine a file’s attributes?
What is the general form of #line preprocessor?
How do we print only part of a string in c?
Write a c program to build a heap method using Pointer to function and pointer to structure ?