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 the difference between break and continue?
What is the usage of the pointer in c?
What is the sizeof () operator?
program to find out date after adding 31 days to a date in the month of febraury also consider the leap year
How can I direct output to the printer?
What is #ifdef ? What is its application?
What are the different types of data structures in c?
to print the salary of an employee according to follwing calculation: Allowances:HRA-20% of BASIC,DA-45% of BASIC,TA-10%. Deductions:EPF-8% of BASIC,LIC-Rs.200/-Prof.Tax:Rs.200/- create c language program?
What are the basic data types associated with c?
In C language, a variable name cannot contain?
I came across some code that puts a (void) cast before each call to printf. Why?
What is unary operator?
i want to switch my career from quailty assurance engineering to development kindly guide me from which programming language its better for me to start plz refer some courses or certifications too i have an experience of 1.5 yrs in QA field.Kindly guide me
What is #define used for in c?
What is build process in c?