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
How can I convert a number to a string?
Write the syntax and purpose of a switch statement in C.
How many levels of indirection in pointers can you have in a single declaration?
What are pointers in C? Give an example where to illustrate their significance.
Write a program to print factorial of given number without using recursion?
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?
Ow can I insert or delete a line (or record) in the middle of a file?
What is array within structure?
What is meant by inheritance?
Explain how do I determine whether a character is numeric, alphabetic, and so on?
What is the difference between memcpy and memmove?
How can you check to see whether a symbol is defined?
What is a union?
List some basic data types in c?
write a program to create a sparse matrix using dynamic memory allocation.