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 the program for prime numbers?

Answer Posted / ashok

void main()
{
int i,n;
clrscr();
printf("\nEnter the range:");
scanf("%d",&n)
printf("Prime numbers are:");
for(i=1;i<=n;i++)
{
if(i==2 || i==3 || i==5 || i==7)
printf("%d ",i);
if(i%2!=0 && i%3!=0 && i%5!=0 && i%7!=0)
printf("%d ",i);
}
getch();
}

Is This Answer Correct ?    7 Yes 8 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what is the basis for selection of arrays or pointers as data structure in a program

4250


Why is void main used?

1035


What is action and transformation in spark?

1082


Function calling procedures? and their differences? Why should one go for Call by Reference?

1041


How is pointer initialized in c?

976


What is pass by reference in functions?

771


A character flag or control mechanism that delineates one data item from another a) variable b) constant c) delimiter d) call by reference

1044


What do you mean by command line argument?

1098


Can we initialize extern variable in c?

1076


How can I find out how much free space is available on disk?

1014


What is volatile variable in c with example?

997


What is a sequential access file?

1094


Please send me WIPRO technical question to my mail ID.. its nisha_g28@yahoo.com please its urgent

2074


Why are all header files not declared in every c program?

1042


What is queue in c?

1034