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 / paps

#include<stdio.h>
void main()
{
int a=1,i,j,b,n;
printf("enter the range\n");
scanf("%d",&n);
printf("prime number series between 1 to %d:n");
printf("%d",a);
while(i<=n)
{
for(j=2;j<i;j++)
{
b=i%j;
if(b==0)
break;
}
if(i==j)
printf("%d",i);
i++;
}
getch();
}

Is This Answer Correct ?    8 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is difference between structure and union?

1079


What does the format %10.2 mean when included in a printf statement?

1587


What is the purpose of void pointer?

986


Why main function is special give two reasons?

1483


How will you find a duplicate number in a array without negating the nos ?

2082


What are the different types of linkage exist in c?

972


Explain the bubble sort algorithm.

1005


Which header file is used for clrscr?

999


The statement, int(*x[]) () what does in indicate?

1084


Do you know the purpose of 'register' keyword?

968


What is data structure in c language?

1056


What are the benefits of c language?

1109


what is stack , heap ,code segment,and data segment

2633


How can you avoid including a header more than once?

928


explain what is an endless loop?

1033