Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

What are directives in c?

926


Explain Basic concepts of C language?

1080


What is clrscr ()?

1056


When the macros gets expanded?

1339


Does c have function or method?

943


What is the right type to use for boolean values in c? Is there a standard type?

967


Do you have any idea about the use of "auto" keyword?

1050


can we change the default calling convention in c if yes than how.........?

2471


What is the use of header?

1051


Are there any problems with performing mathematical operations on different variable types?

992


How can I open files mentioned on the command line, and parse option flags?

1015


How do you determine a file’s attributes?

1016


What is the general form of #line preprocessor?

949


How do we print only part of a string in c?

974


Write a c program to build a heap method using Pointer to function and pointer to structure ?

4622