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 c is procedure oriented?

1123


Why is c so powerful?

1163


What are the advantages and disadvantages of a heap?

1258


What is the correct code to have following output in c using nested for loop?

1120


What is p in text message?

1037


Explain how do you override a defined macro?

1134


Is python a c language?

1055


Can an array be an Ivalue?

1137


How is pointer initialized in c?

1091


What does 2n 4c mean?

1310


Why do we write return 0 in c?

1128


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

1143


What is the stack in c?

1227


What is typedef example?

1259


What is a stream in c programming?

1232