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 / priyanka chauhan

// prime no series. //
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j,n;
clrscr();
printf("Enter the no: ");
scanf("%d",&n);
printf("\n");
for(i=1;i<=n;i++)
{
for(j=2;j<=i-1;j++)
{
if(i%j==0)
break;
}
if(j==i)
printf("%d ",j);
}
getch();
}

Is This Answer Correct ?    173 Yes 84 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why is a semicolon (;) put at the end of every program statement?

1080


What is difference between structure and union?

1142


What are header files why are they important?

1097


the real constant in c can be expressed in which of the following forms a) fractional form only b) exponential form only c) ascii form only d) both a and b

2686


What are nested functions in c?

1034


Why use int main instead of void main?

1128


What is %s and %d in c?

1050


What is wild pointer in c?

1085


Is it better to bitshift a value than to multiply by 2?

1096


What is nested structure?

1055


count = 0; for (i = 1;i < = 10; i++);count = count + i; Value of count after execution of the above statements will be a) 0 b) 11 c) 55 d) array

1098


What are the types of data files?

1209


Difference between constant pointer and pointer to a constant.

1157


What is break statement?

1133


explain how do you use macro?

1167